This commit is contained in:
24
dev/html/callback.html
Normal file
24
dev/html/callback.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head> </head>
|
||||
<body>
|
||||
<script>
|
||||
const redirect_url = `"<<BUILDER_PHP_VAR($redirect_url)>>"`;
|
||||
const send_url = `"<<BUILDER_PHP_VAR($send_url)>>"`;
|
||||
|
||||
const href = location.hash;
|
||||
const token = location.hash.substring(
|
||||
href.indexOf("access_token=") + 13,
|
||||
href.indexOf("&"),
|
||||
);
|
||||
if (!token) {
|
||||
window.location.href = redirect_url;
|
||||
}
|
||||
fetch(send_url + "&token=" + encodeURIComponent(token)).then(
|
||||
(response) => {
|
||||
window.location.href = redirect_url;
|
||||
},
|
||||
);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user