mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
made nextjs-ready config
This commit is contained in:
parent
28b8242b4d
commit
8bac6bb2f7
8 changed files with 45 additions and 40 deletions
|
@ -2,6 +2,7 @@ import { IUser } from '~/types/auth';
|
|||
import { EMPTY_USER } from '~/constants/auth';
|
||||
import { makeAutoObservable } from 'mobx';
|
||||
import { isHydrated, makePersistable } from 'mobx-persist-store';
|
||||
import { CONFIG } from '~/utils/config';
|
||||
|
||||
export class AuthStore {
|
||||
token: string = '';
|
||||
|
@ -12,7 +13,7 @@ export class AuthStore {
|
|||
makeAutoObservable(this);
|
||||
|
||||
void makePersistable(this, {
|
||||
name: `vault48_auth_${process.env.REACT_APP_API_URL}`,
|
||||
name: `vault48_auth_${CONFIG.API_HOST}`,
|
||||
properties: ['token', 'user', 'isTesterInternal'],
|
||||
storage: typeof window !== 'undefined' ? window.localStorage : undefined,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue