Merge branch 'master' of github.com:cesanta/mongoose

This commit is contained in:
cpq 2022-08-26 17:41:22 +01:00
commit 2d45ba1981

View File

@ -69,13 +69,13 @@ const App = function () {
.catch(err => console.log(err)); .catch(err => console.log(err));
const login = function (u) { const login = function (u) {
document.cookie = `access_token=${u.token};path=/;max-age=3600`; document.cookie = `access_token=${u.token}; Secure, HttpOnly; SameSite=Lax; path=/; max-age=3600`;
setUser(u.user); setUser(u.user);
return getin(); return getin();
}; };
const logout = () => { const logout = () => {
document.cookie = `access_token=;path=/;max-age=0`; document.cookie = `access_token=; Secure, HttpOnly; SameSite=Lax; path=/; max-age=0`;
setUser(''); setUser('');
}; };