Skip to content

Documentation / react-auth / useCustomAuth

Function: useCustomAuth()

useCustomAuth(callbacks?): UseCustomAuth

Use this hook to check the Privy auth flow status for whenever third-party/custom auth is enabled.

Parameters

callbacks?: Object

callbacks.onAuthenticated?: (o) => void

Callback that will execute when Privy successfully exchanges a custom auth JWT for a Privy JWT

Param The Privy user

callbacks.onUnauthenticated?: () => void

Callback that will execute when Privy detects a user is logged out from the third-party auth system, and correspondingly logs the user out.

Returns

UseCustomAuth

status - auth flow/ JWT exchange status of the Privy user, if custom auth is enabled