-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
27 lines (27 loc) · 940 Bytes
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Redirection Page</title>
</head>
<body>
<h1>Authentication Redirection Page</h1>
<script>
(function () {
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const authCode = urlParams.get("code");
const redirectUrlWithProvider = urlParams.get("state").split("|");
const redirectUrl = redirectUrlWithProvider[0];
const provider = redirectUrlWithProvider[1];
if (authCode && redirectUrl && provider) {
const newUrl = new URL(redirectUrl);
newUrl.searchParams.set("code", authCode);
newUrl.searchParams.set("provider", provider);
window.location.href = newUrl.toString();
}
})();
</script>
</body>
</html>