This repository has been archived by the owner on Dec 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yauheni
committed
Aug 26, 2023
1 parent
0917a1b
commit f279544
Showing
5 changed files
with
50 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { atom } from 'jotai'; | ||
import { AUTH_TOKEN_LOCAL_STORAGE_KEY } from './consts'; | ||
|
||
export const AUTH_TOKEN_ATOM = atom<string | null>(localStorage.getItem(AUTH_TOKEN_LOCAL_STORAGE_KEY)); | ||
|
||
export const TESTNET_USERNAME_ATOM = atom(''); | ||
|
||
export const IS_AUTH_READY_ATOM = atom(false); |
6 changes: 3 additions & 3 deletions
6
frontend/src/features/Auth/components/ProtectedRoute/ProtectedRoute.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
import { atom } from 'jotai'; | ||
export const AUTH_API_ADDRESS = process.env.REACT_APP_AUTH_API_ADDRESS as string; | ||
|
||
const AUTH_API_ADDRESS = process.env.REACT_APP_AUTH_API_ADDRESS as string; | ||
export const AUTH_MESSAGE = 'VARA'; | ||
|
||
const AUTH_MESSAGE = 'VARA'; | ||
|
||
const AUTH_TOKEN_LOCAL_STORAGE_KEY = 'authToken'; | ||
|
||
const AUTH_TOKEN_ATOM = atom<string | null>(localStorage.getItem(AUTH_TOKEN_LOCAL_STORAGE_KEY)); | ||
|
||
export { AUTH_API_ADDRESS, AUTH_MESSAGE, AUTH_TOKEN_LOCAL_STORAGE_KEY, AUTH_TOKEN_ATOM }; | ||
export const AUTH_TOKEN_LOCAL_STORAGE_KEY = 'authToken'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters