mirror of https://github.com/Lissy93/dashy.git
🐛 Re: #70 - Error on login form when remember me is set to never
This commit is contained in:
parent
25bd214a19
commit
dfd6bb9608
|
@ -69,7 +69,8 @@ export const login = (username, pass, timeout) => {
|
|||
const now = new Date();
|
||||
const expiry = new Date(now.setTime(now.getTime() + timeout)).toGMTString();
|
||||
const userObject = { user: username, hash: sha256(pass).toString().toLowerCase() };
|
||||
document.cookie = `authenticationToken=${generateUserToken(userObject)}; expires=${expiry}`;
|
||||
document.cookie = `authenticationToken=${generateUserToken(userObject)};`
|
||||
+ `${timeout > 0 ? `expires=${expiry}` : ''}`;
|
||||
localStorage.setItem(localStorageKeys.USERNAME, username);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue