auth.js 365 Bytes
Newer Older
한규민's avatar
push    
한규민 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import config from "./clientConfig";

export function handleLogin(user) {
    if (user) {
        localStorage.setItem(config.loginUser, JSON.stringify(user));
    }
}

export function getLocalUser() {
    const userData = localStorage.getItem(config.loginUser);
    let user = null;
    if (userData) {
        user = JSON.parse(userData);
    }
    return user;
}