forked from Hektve87/upriver.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcallback.html
More file actions
23 lines (22 loc) · 850 Bytes
/
callback.html
File metadata and controls
23 lines (22 loc) · 850 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 lang="en">
<head>
<meta charset="utf-8">
<title>Loading...</title>
</head>
<body>
Loading...
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script>
<script>
if (window.location.href.match(/\?code=(.*)/)) {
var code = window.location.href.match(/\?code=(.*)/)[1];
$.getJSON('https://upriver.herokuapp.com/authenticate/' + code, function(data) {
sessionStorage.setItem('token', data.token);
window.location = 'https://upriver.github.io/';
});
} else {
window.location = 'https://github.com/login/oauth/authorize?client_id=d39dea3b2637ce0c4fdb&scope=repo';
}
</script>
</body>
</html>