-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcallback.html
More file actions
25 lines (23 loc) · 788 Bytes
/
callback.html
File metadata and controls
25 lines (23 loc) · 788 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Auth Callback</title>
</head>
<body>
<script>
// Supabase will redirect here with the access_token/id_token in the URL hash
// Example: https://your-webpage.com/callback#access_token=...&type=...&expires_in=...
const hash = window.location.hash.substr(1); // remove #
const params = new URLSearchParams(hash);
const accessToken = params.get('access_token');
const idToken = params.get('id_token');
if (accessToken) {
// Redirect to your app using deep link and pass the token
window.location.href = myapp://login-callback?access_token=${accessToken}&id_token=${idToken};
} else {
document.body.innerHTML = "Login failed or cancelled.";
}
</script>
</body>
</html>