-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
51 lines (46 loc) · 1.64 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="google-signin-client_id" content="692664707782-8961gf303pq28oedc4qqd03qum9fa1pq.apps.googleusercontent.com">
<script src="https://apis.google.com/js/platform.js" async defer></script>
<title>Login</title>
</head>
<body>
<div class="g-signin2" data-onsuccess="onSignIn"></div>
<button onclick="signOut()">signout</button>
<!-- <div onclick="signOut">signout</div> -->
<!-- <a href="#" onclick="signOut();">Sign out</a> -->
<script>
function signOut() {
var auth2 = gapi.auth2.getAuthInstance();
auth2.signOut().then(function () {
console.log('User signed out.');
});
}
</script>
<script>
function onSignIn(googleUser) {
console.log("why this shit is running");
var id_token = googleUser.getAuthResponse().id_token;
console.log(id_token);
// var xhr = new XMLHttpRequest();
// xhr.open('POST', '/login');
// xhr.setRequestHeader('Content-Type', 'application/json');
// xhr.onload = function() {
// console.log('Signed in as: ' + xhr.responseText);
// if(xhr.responseText == 'success'){
//
//
// }
// };
// xhr.send(JSON.stringify({token : id_token}));
signOut();
location.assign('http://localhost:5500/test.html');
}
</script>
<p>oo mere yaar ki shadi hai , to bas tu mje kar</p>
<h2>oo mere yaar ki shadi hai , to bas tu mje kar</h2>
</body>
</html>