-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth.html
More file actions
23 lines (23 loc) · 818 Bytes
/
auth.html
File metadata and controls
23 lines (23 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CaFeLUG DMS</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>
<body>
<a href="https://github.com/login/oauth/authorize?scope=user:email&client_id=32df65621de991fe9df0">Acceder via GitHub</a>
<script>
let code = window.location.href.match(/\?code=(.*)/)[1];
$.getJSON('https://cafelug-dms.herokuapp.com/authenticate/'+code, function(data) {
if (typeof(Storage) !== "undefined") {
if(data) localStorage.setItem('token',data.token);
window.location='https://cafelug.github.io/';
} else {
console.log('Sorry! No Web Storage support...')
}
console.log(data.token);
});
</script>
</body>
</html>