Fixed a bug with cookies v0.0.6
Couldn't access cookie on root domain
This commit is contained in:
parent
a4b5fd2dd6
commit
da7d26a3aa
@ -86,7 +86,7 @@ const setCookie = (token, type, expires_days) => {
|
|||||||
const d = new Date();
|
const d = new Date();
|
||||||
d.setTime(d.getTime() + (expires_days*24*60*60*1000))
|
d.setTime(d.getTime() + (expires_days*24*60*60*1000))
|
||||||
let expires = `expires=${d.toUTCString()}`;
|
let expires = `expires=${d.toUTCString()}`;
|
||||||
document.cookie = `token=${token},type=${type},${expires}`;
|
document.cookie = `token=${token},type=${type},${expires}; path=/`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getCookie = (returnType) => {
|
const getCookie = (returnType) => {
|
||||||
|
@ -57,6 +57,7 @@ const validateUser = async (parsedJson) => {
|
|||||||
|
|
||||||
|
|
||||||
// return to home. at a later point set it to the user page
|
// return to home. at a later point set it to the user page
|
||||||
|
document.localStorage
|
||||||
window.location.href = '/';
|
window.location.href = '/';
|
||||||
}));
|
}));
|
||||||
} else if (parsedJson.detail == "Invalid password") {
|
} else if (parsedJson.detail == "Invalid password") {
|
||||||
@ -82,7 +83,7 @@ const setCookie = (token, type, expires_days) => {
|
|||||||
const d = new Date();
|
const d = new Date();
|
||||||
d.setTime(d.getTime() + (expires_days*24*60*60*1000))
|
d.setTime(d.getTime() + (expires_days*24*60*60*1000))
|
||||||
let expires = `expires=${d.toUTCString()}`;
|
let expires = `expires=${d.toUTCString()}`;
|
||||||
document.cookie = `token=${token},type=${type},${expires}`;
|
document.cookie = `token=${token},type=${type},${expires}; path=/`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getCookie = (returnType) => {
|
const getCookie = (returnType) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user