Merge pull request #1687 from cesanta/webui-login

Fix SameSite cookie value
This commit is contained in:
Sergio R. Caprile authored and GitHub committed 2022-08-26 10:24:00 -03:00
commit d1124703b7
1 file changed
+2 -2
+2 -2
View File
@@ -69,13 +69,13 @@ const App = function () {
.catch(err => console.log(err));
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);
return getin();
};
const logout = () => {
document.cookie = `access_token=;path=/;max-age=0`;
document.cookie = `access_token=; Secure, HttpOnly; SameSite=Lax; path=/; max-age=0`;
setUser('');
};