Updates
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import getCsrfHeaderName from "../../package-shared/actions/get-csrf-header-name";
|
||||
import parseClientCookies from "../utils/parseClientCookies";
|
||||
/**
|
||||
* Login with Google Function
|
||||
@@ -38,7 +39,7 @@ export default async function logout(params?: {
|
||||
////////////////////////////////////////
|
||||
|
||||
localStorage.setItem("user", "{}");
|
||||
localStorage.removeItem("csrf");
|
||||
localStorage.removeItem(getCsrfHeaderName());
|
||||
|
||||
document.cookie = `datasquirel_social_id=null;samesite=strict;path=/`;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import getCsrfHeaderName from "../../package-shared/actions/get-csrf-header-name";
|
||||
import { APILoginFunctionReturn } from "../../package-shared/types";
|
||||
|
||||
/**
|
||||
@@ -11,7 +12,7 @@ export default function postLogin(res: APILoginFunctionReturn): boolean {
|
||||
try {
|
||||
if (!res.payload) return false;
|
||||
if (!res.payload.csrf_k) return false;
|
||||
localStorage.setItem("csrf", res.payload.csrf_k);
|
||||
localStorage.setItem(getCsrfHeaderName(), res.payload.csrf_k);
|
||||
localStorage.setItem("user", JSON.stringify(res.payload));
|
||||
return true;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user