diff options
| author | leonoverweel <l.overweel@gmail.com> | 2017-04-01 21:36:22 +0200 |
|---|---|---|
| committer | leonoverweel <l.overweel@gmail.com> | 2017-04-01 21:36:22 +0200 |
| commit | a06c408964dab6069b894c8fe11d09afdd7f9b81 (patch) | |
| tree | d32c7c05bd02f40bc1f0146b76d2c32416baf4ee /static | |
| parent | bb4a12a0cf9c412c57879229226762f06c3390e7 (diff) | |
Replace web server test w/ auth token page
Diffstat (limited to 'static')
| -rw-r--r-- | static/index.html | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/static/index.html b/static/index.html index 744f7d27..3fc1c2d0 100644 --- a/static/index.html +++ b/static/index.html @@ -3,36 +3,9 @@ <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.6/socket.io.min.js"></script> <script> function onSignIn(googleUser) { - var id_token = googleUser.getAuthResponse().id_token; - - var socket = io.connect('http://' + document.domain + ':' + location.port); - socket.on('connect', function() { - socket.emit('request', { - id: 234, - path: "/v1/simulations/{simulationId}", - method: "GET", - parameters: { - body: { - - }, - path: { - simulationId: 1 - }, - query: { - email:'l.overweel@gmail.com' - } - }, - token: id_token - }); - }) - - socket.on('response', function(response) { - console.log(JSON.parse(response)); - }); + document.getElementById('token').innerText = googleUser.getAuthResponse().id_token; } - </script> - <script> function signOut() { var auth2 = gapi.auth2.getAuthInstance(); @@ -44,3 +17,6 @@ function onSignIn(googleUser) { <div class="g-signin2" data-onsuccess="onSignIn"></div> <a href="#" onclick="signOut();">Sign out</a> + +<p>Your auth token:</p> +<p id="token" style="word-wrap:break-word;">Loading...</p>
\ No newline at end of file |
