File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44// This is added to support web for reaniamted: https://github.com/software-mansion/react-native-reanimated/issues/4140#issuecomment-1455209588
55import 'setimmediate'
66import 'react-native-reanimated'
7+ // This is added to work jwt-decode for react-native: https://github.com/auth0/jwt-decode?tab=readme-ov-file#polyfilling-atob
8+ import 'core-js/stable/atob'
79
810// Rest imports
911import '@baca/i18n'
Original file line number Diff line number Diff line change 108108 "@react-navigation/stack" : " ^6.3.20" ,
109109 "@tanstack/react-query" : " ^4.29.19" ,
110110 "axios" : " ^1.6.7" ,
111+ "core-js" : " ^3.37.1" ,
111112 "expo" : " ~50.0.17" ,
112113 "expo-apple-authentication" : " ~6.3.0" ,
113114 "expo-application" : " ~5.8.4" ,
Original file line number Diff line number Diff line change 1+ import { AuthControllerRefreshMutationResult } from '@baca/api/query/auth/auth'
12import { ASYNC_STORAGE_KEYS , ENV } from '@baca/constants'
23import { decodeAccessToken , secureStore , wait } from '@baca/utils'
34
@@ -72,11 +73,13 @@ export const refreshTokenIfNeeded = async (token: Token): Promise<Token> => {
7273 if ( shouldRefreshToken && ! isRefreshingToken ) {
7374 store . set ( isRefreshingTokenAtom , true )
7475
75- // const refreshedToken: AuthControllerRefreshMutationResult = (await fetch( //FIXME: uncomment this line when type from BE will be improved
76- const refreshedToken = ( await fetch ( `${ ENV . API_URL } api/v1/auth/refresh` , {
77- method : 'POST' ,
78- headers : { Authorization : `Bearer ${ token . refreshToken } ` } ,
79- } ) . then ( ( response ) => response . json ( ) ) ) as unknown as Token //FIXME: remove when type from BE will be correct
76+ const refreshedToken : AuthControllerRefreshMutationResult = await fetch (
77+ `${ ENV . API_URL } api/v1/auth/refresh` ,
78+ {
79+ method : 'POST' ,
80+ headers : { Authorization : `Bearer ${ token . refreshToken } ` } ,
81+ }
82+ ) . then ( ( response ) => response . json ( ) )
8083
8184 if ( token ) {
8285 await setToken ( refreshedToken )
Original file line number Diff line number Diff line change @@ -5435,6 +5435,11 @@ core-js-compat@^3.31.0, core-js-compat@^3.36.1:
54355435 dependencies:
54365436 browserslist "^4.23.0"
54375437
5438+ core-js@^3.37.1:
5439+ version "3.37.1"
5440+ resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.37.1.tgz#d21751ddb756518ac5a00e4d66499df981a62db9"
5441+ integrity sha512-Xn6qmxrQZyB0FFY8E3bgRXei3lWDJHhvI+u0q9TKIYM49G8pAr0FgnnrFRAmsbptZL1yxRADVXn+x5AGsbBfyw==
5442+
54385443core-util-is@~1.0.0:
54395444 version "1.0.3"
54405445 resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
You can’t perform that action at this time.
0 commit comments