-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
34 lines (29 loc) · 946 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
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<head>
<script>
// Function to extract the token from the URL
function getTokenFromUrl() {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get("token");
}
// Function to perform the redirect
function redirectToApp() {
const token = getTokenFromUrl();
if (token) {
// Redirect to the app with the token
window.location.href = `app://tastepass?token=${token}`;
} else {
// Handle the case where the token is not present in the URL
alert("Token not found in the URL.");
}
}
// Automatically call the redirect function when the page loads
window.onload = redirectToApp;
</script>
</head>
<body>
<div>hi</div>
<!-- You can add some content here if needed -->
</body>
</html>