-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth.html
More file actions
28 lines (27 loc) · 771 Bytes
/
Copy pathauth.html
File metadata and controls
28 lines (27 loc) · 771 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>OneDrive Authentication</title>
<script>
// Token aus der URL extrahieren
function getTokenFromHash() {
const hash = window.location.hash.substring(1);
const params = new URLSearchParams(hash);
return params.get('access_token');
}
// Nach dem Laden der Seite
window.onload = function() {
const token = getTokenFromHash();
if (token) {
// Token an die Hauptseite senden
window.opener.postMessage({ token: token }, window.location.origin);
} else {
document.body.innerHTML = "<p>Authentication failed. Please try again.</p>";
}
};
</script>
</head>
<body>
<p>Authentication successful. You can close this window.</p>
</body>
</html>