Updates
This commit is contained in:
Vendored
+3
-9
@@ -1,10 +1,4 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = postLogin;
|
||||
const get_csrf_header_name_1 = __importDefault(require("../../package-shared/actions/get-csrf-header-name"));
|
||||
import getCsrfHeaderName from "../../package-shared/actions/get-csrf-header-name";
|
||||
/**
|
||||
* Client Setup After Login
|
||||
* ===============================================================================
|
||||
@@ -12,13 +6,13 @@ const get_csrf_header_name_1 = __importDefault(require("../../package-shared/act
|
||||
* is logged in. Use this in conjunction with the `datasquirel.user.loginUser`
|
||||
* function
|
||||
*/
|
||||
function postLogin(res) {
|
||||
export default function postLogin(res) {
|
||||
try {
|
||||
if (!res.payload)
|
||||
return false;
|
||||
if (!res.payload.csrf_k)
|
||||
return false;
|
||||
localStorage.setItem((0, get_csrf_header_name_1.default)(), res.payload.csrf_k);
|
||||
localStorage.setItem(getCsrfHeaderName(), res.payload.csrf_k);
|
||||
localStorage.setItem("user", JSON.stringify(res.payload));
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user