1- /* eslint-disable @typescript-eslint/no-empty-function */
21import * as React from 'react' ;
32import jwt_decode from 'jwt-decode' ;
43import { UserInfo , Credentials } from 'react-native-auth0' ;
@@ -60,7 +59,6 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({ children, config })
6059
6160
6261 const login = React . useCallback ( async ( ) => {
63- console . log ( 'calling lodgin' ) ;
6462 // to have more control when dispatching avoid using the createAction here
6563 setLoading ( true ) ;
6664 let authorizeResponse : Credentials ;
@@ -80,7 +78,6 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({ children, config })
8078
8179 const email = authorizeUserInfo ?. email ;
8280 try {
83- // This hook should not depend on any action, but for the little time I have I leave it like this
8481 await fetchUser ( eichBaseEndpoint , eichBaseToken ) ;
8582 } catch ( error ) {
8683 console . log ( 'eichbase error' , JSON . stringify ( error ) ) ;
@@ -103,7 +100,6 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({ children, config })
103100
104101
105102 const logout = React . useCallback ( async ( ) => {
106- console . log ( 'logout' ) ;
107103 try {
108104 await auth0 . webAuth . clearSession ( ) ;
109105 } catch ( error ) {
@@ -114,17 +110,14 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({ children, config })
114110 } , [ auth0 , removeToken ] ) ;
115111
116112
117- const AuthenticateCheck = async ( ) : Promise < void > => {
118- console . log ( 'start auth --- getting store token' , auth0 ) ;
113+ const authenticateCheck = async ( ) : Promise < void > => {
119114 const storedCredentials = await onGetStoreToken ( ) ;
120115
121116 if ( ! storedCredentials ) {
122117 setLoading ( false ) ;
123118 return ;
124119 }
125120
126- console . log ( 'requesting auth token' ) ;
127-
128121 let request ;
129122 try {
130123 request = await auth0 . auth . userInfo ( {
@@ -142,8 +135,7 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({ children, config })
142135 } ;
143136
144137 React . useEffect ( ( ) => {
145- console . log ( 'use effect' ) ;
146- AuthenticateCheck ( ) ;
138+ authenticateCheck ( ) ;
147139 // eslint-disable-next-line react-hooks/exhaustive-deps
148140 } , [ ] ) ;
149141
0 commit comments