You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The requireLocalAuthentication method exposed by the useAuth hook does not seem to work.
I have a hunch that it is because requireLocalAuthentication cannot be called after getCredentials, however a useEffect in Auth0Provider.tsx (line 79) calls getCredentials on mount. So this condition cannot be satisfied.
I can call the requireLocalAuthentication method exposed by the Auth0 directly as a workaround:
constconfigureLocalAuthentication=async()=>{constauth0=newAuth0({
clientId,
domain,})try{awaitauth0.credentialsManager.requireLocalAuthentication()}catch(error){console.error(error)}}exportconstAuthManager=({ children }: PropsWithChildren)=>{useEffect(()=>{configureLocalAuthentication()},[])return(<Auth0Providerdomain={domain}clientId={clientId}>{children}</Auth0Provider>)}
I have tested this on a real device.
Reproduction
Setup the provider
Down the tree, call the requireLocalAuthentication exposed by the useAuth hook
Checklist
Description
The
requireLocalAuthentication
method exposed by theuseAuth
hook does not seem to work.I have a hunch that it is because
requireLocalAuthentication
cannot be called aftergetCredentials
, however a useEffect inAuth0Provider.tsx
(line 79) callsgetCredentials
on mount. So this condition cannot be satisfied.I can call the
requireLocalAuthentication
method exposed by theAuth0
directly as a workaround:I have tested this on a real device.
Reproduction
requireLocalAuthentication
exposed by theuseAuth
hookAdditional context
No response
react-native-auth0 version
3.1.0
React Native version
0.72.10
Expo version
49.0.23
Platform
iOS
Platform version(s)
17.4
The text was updated successfully, but these errors were encountered: