Repository navigation
Expand file tree
/
Copy pathcallback.html
More file actions
58 lines (52 loc) · 1.51 KB
/
Copy pathcallback.html
File metadata and controls
58 lines (52 loc) · 1.51 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Linglear Login Redirect</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #0d1117;
color: #c9d1d9;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
text-align: center;
}
#status {
font-size: 1.2em;
}
</style>
</head>
<body>
<div>
<h1>🔐 Logging you in to Linglear...</h1>
<p id="status">Waiting for Cognito response...</p>
</div>
<script>
function parseHashParams(hash) {
const params = {};
hash.substring(1).split("&").forEach(pair => {
const [key, value] = pair.split("=");
if (key && value) {
params[key] = decodeURIComponent(value);
}
});
return params;
}
const params = parseHashParams(window.location.hash);
if (params.id_token) {
document.getElementById("status").innerText = "✅ Login successful. Redirecting to extension...";
const extensionId = "agdbknoebcbbaegohkblhdcjcmlekdbe";
const iframe = document.createElement("iframe");
iframe.style.display = "none";
iframe.src = `chrome-extension://${extensionId}/callback.html?id_token=${params.id_token}`;
document.body.appendChild(iframe);
} else {
document.getElementById("status").innerText = "❌ Login failed. No token received.";
}
</script>
</body>
</html>