File tree Expand file tree Collapse file tree 4 files changed +12
-48
lines changed
Expand file tree Collapse file tree 4 files changed +12
-48
lines changed Original file line number Diff line number Diff line change 2626 -->
2727 < title > React App</ title >
2828 < script >
29- window . setAuthTokenQueue = [ ] ;
3029 window . setAuthToken = ( accessToken , refreshToken ) => {
31- console . log ( 'Placeholder setAuthToken called. Queuing tokens.' ) ;
32- window . setAuthTokenQueue . push ( [ accessToken , refreshToken ] ) ;
30+ console . log ( 'setAuthToken from index.html 실행됨!' , accessToken , refreshToken ) ;
31+ const expires = new Date ( ) ;
32+ expires . setDate ( expires . getDate ( ) + 7 ) ;
33+ const expiresString = expires . toUTCString ( ) ;
34+
35+ if ( accessToken ) {
36+ document . cookie = `access_token=${ accessToken } ; path=/; expires=${ expiresString } ;` ;
37+ }
38+ if ( refreshToken ) {
39+ document . cookie = `refresh_token=${ refreshToken } ; path=/; expires=${ expiresString } ;` ;
40+ }
41+ window . location . reload ( ) ;
3342 } ;
3443 </ script >
3544 </ head >
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ export {};
33declare global {
44 interface Window {
55 setAuthToken : ( accessToken : string , refreshToken : string ) => void ;
6- setAuthTokenQueue ?: [ string , string ] [ ] ;
76 ReactNativeWebView ?: {
87 postMessage : ( message : string ) => void ;
98 } ;
Original file line number Diff line number Diff line change @@ -2,9 +2,6 @@ import React from 'react';
22import ReactDOM from 'react-dom/client' ;
33import App from './App' ;
44import reportWebVitals from './reportWebVitals' ;
5- import { registerSetAuthToken } from './utils/setAuthToken' ;
6-
7- registerSetAuthToken ( ) ;
85
96const root = ReactDOM . createRoot (
107 document . getElementById ( 'root' ) as HTMLElement ,
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments