File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed
Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change 11import { atom } from 'recoil' ;
22
3- const localStorageEffect =
4- key =>
5- ( { setSelf, onSet } ) => {
6- const savedValue = localStorage . getItem ( key ) ;
7- if ( savedValue != null ) setSelf ( JSON . parse ( savedValue ) ) ;
8-
9- onSet ( newValue => {
10- if ( newValue ) localStorage . setItem ( key , JSON . stringify ( newValue ) ) ;
11- else localStorage . removeItem ( key ) ;
12- } ) ;
13- } ;
14-
153export const authState = atom ( {
164 key : 'authState' ,
175 default : {
186 isAuthenticated : false ,
197 } ,
20- effects : [ localStorageEffect ( 'authState' ) ] ,
8+ effects : [ ] ,
219} ) ;
Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ import reportWebVitals from './reportWebVitals';
1515import Router from './router' ;
1616import { DomainProvider } from './contexts/DomainContext' ;
1717
18+ localStorage . removeItem ( 'authState' ) ;
19+ localStorage . removeItem ( 'refreshToken' ) ;
20+ localStorage . removeItem ( 'accessToken' ) ;
21+
1822export const queryClient = new QueryClient ( ) ;
1923
2024const root = ReactDOM . createRoot ( document . getElementById ( 'root' ) ) ;
You can’t perform that action at this time.
0 commit comments