-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloggedout.html
43 lines (35 loc) · 1.26 KB
/
loggedout.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
39
40
41
42
43
<html>
<head>
<title>Cognito Authentication Test - CALLBACK</title>
<script type="application/javascript" src="webapp.js"></script>
</head>
<body>
<p id="messageLine">Busy logging out....</p>
<hr />
<p>
<a href="index.html">HOME</a>
</p>
</body>
<script type="application/javascript">
if (isLoggedIn()) {
var data = {
"AccessToken": sessionStorage.getItem('access_token')
}
clearSessionStorage();
postDataJsonAwsCognito("GlobalSignOut", data).then(
responseData => {
console.log(JSON.stringify(responseData));
if (responseData['error']) {
document.getElementById("messageLine").innerText = "Error Message: " + responseData['error'];
return;
}
document.getElementById("messageLine").innerHTML = "Redirecting to home page. If it does not work automatically, <a href=\"/index.html\">click here</a>";
goHome();
}
);
} else {
document.getElementById("messageLine").innerHTML = "NOT LOGGED IN... Redirecting to home page. If it does not work automatically, <a href=\"/index.html\">click here</a>";
goHome();
}
</script>
</html>