Skip to content

Commit

Permalink
feat: Add ot_username cookie on successful login
Browse files Browse the repository at this point in the history
  • Loading branch information
BernieHuang2008 committed Jul 15, 2024
1 parent 75f6f2a commit 337a6bd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions login.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ <h2 id="slogan" ia-group="welcome"></h2>
if (response.code == 0) {
// Login successful
document.cookie = `ot_auth_token=${response.token}; expires=${new Date(Date.now() + 60 * 24 * 60 * 60 * 1000).toUTCString()}`;
document.cookie = `ot_username=${username}; expires=${new Date(Date.now() + 60 * 24 * 60 * 60 * 1000).toUTCString()}`;
window.location.href = "/";
} else {
// Login failed
Expand Down

0 comments on commit 337a6bd

Please sign in to comment.