-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdummy_sso_real.html
More file actions
37 lines (33 loc) · 1.11 KB
/
dummy_sso_real.html
File metadata and controls
37 lines (33 loc) · 1.11 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Dummy SSO</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; margin: 0;">
<h2>Dummy OAuth Login</h2>
<button onclick="redirectBack()" style="padding: 16px 24px; font-size: 18px; cursor: pointer; border-radius: 8px;">
Authorize
</button>
<script>
let callbackUrl = "";
// Read ?redirect=<url> from query params
function getQueryParam(param) {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get(param);
}
function redirectBack() {
if (callbackUrl) {
window.location.href = callbackUrl;
} else {
alert("No callback URL provided!");
}
}
// On page load
window.onload = function () {
callbackUrl = getQueryParam("redirect");
console.log("Callback URL:", callbackUrl);
};
</script>
</body>
</html>