-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscript.js
26 lines (24 loc) · 932 Bytes
/
script.js
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
function signIn() {
// Sign in to Google
let oauth2Endpoint = 'https://accounts.google.com/o/oauth2/v2/auth';
let form = document.createElement('form');
form.setAttribute('method', 'GET');
form.setAttribute('action', oauth2Endpoint);
let params={
'client_id': '941348030676-7vgban26e5ve72u8oep724oru483g052.apps.googleusercontent.com',
'redirect_uri': 'https://athletix.netlify.app/home.html',
'response_type': 'token',
"scope": "https://www.googleapis.com/auth/userinfo.profile",
"include_granted_scopes": "true",
"state": "pass-through value"
}
for(var p in params){
let input = document.createElement('input');
input.setAttribute('type', 'hidden');
input.setAttribute('name', p);
input.setAttribute('value', params[p]);
form.appendChild(input);
}
document.body.appendChild(form)
form.submit()
}