-
Notifications
You must be signed in to change notification settings - Fork 0
/
student.html
38 lines (33 loc) · 1.49 KB
/
student.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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Test Site: Student</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body onload="hiStudent()">
<h1>Student Page</h1>
Hello World!
<br>
<p> Press below </p>
<button><a href="index.html">Back</a></button>
<script>
function hiStudent(googleUser) {
console.log('Condragulations.')
console.log('Successful redirection from login to the student.html page after sign-in.')
// Useful data for your client-side scripts:
var profile = googleUser.getBasicProfile();
// console.log('Profile: ' + profile):
console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
console.log('Full Name: ' + profile.getName());
console.log('Given Name: ' + profile.getGivenName());
console.log('Family Name: ' + profile.getFamilyName());
console.log('Image URL: ' + profile.getImageUrl());
console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
// The ID token you need to pass to your backend:
var id_token = googleUser.getAuthResponse().id_token;
console.log("ID Token: " + id_token);
}
</script>
</body>
</html>