forked from gabrielsroka/gabrielsroka.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterstitial.html
32 lines (30 loc) · 829 Bytes
/
interstitial.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
<!doctype html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title>Interstitial</title>
</head>
<body>
<script>
onload = async function () {
// For this to work, enable CORS in Okta: Security > API > Trusted Origins > Add Origin > CORS.
const baseUrl = 'https://gsroka-neto.oktapreview.com';
const init = {
credentials: 'include',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json'
}
};
try {
var response = await fetch(baseUrl + '/api/v1/users/me', init);
} catch (e) {
console.log("error", e);
return;
}
const user = await response.json();
if (user.profile.interstitialGo) top.location = "https://gabrielsroka.github.io";
};
</script>
</body>
</html>