-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed problems with token refreshing, can now save uuid in cookie
- Loading branch information
Showing
5 changed files
with
58 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const uuidInput = document.getElementById("uuid"); | ||
const rememberUuid = document.getElementById("remember-uuid"); | ||
|
||
uuidInput.oninput = doRemember; | ||
rememberUuid.onchange = doRemember; | ||
|
||
function doRemember() { | ||
if (rememberUuid.checked) { | ||
document.cookie = "uuid=" + uuidInput.value + "; expires=" + new Date(new Date().getFullYear + 5).toUTCString() + ", path=/"; | ||
} | ||
else { | ||
document.cookie = "uuid=; expires=Thu, 01 Jan 1970 00:00:00 UTC, path=/"; | ||
} | ||
} | ||
|
||
function uuid() { | ||
return "?uuid=" + uuidInput.value; | ||
} | ||
|
||
if (document.cookie.indexOf("uuid=") != -1) { | ||
uuidInput.value = document.cookie.split("=")[1]; | ||
rememberUuid.checked = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters