Minor Changes
-
39df4d5: Deprecate
useAuthLoading
and introduceuseAuthenticationStatus
When using bothuseAuthLoading
anduseAuthenticated
together, the hooks rerender independently from each other.
As a result, when a user loads the page while he previously authenticated, the hooks values were chronologically:isLoading isAuthenticated true
false
false
false
false
true
The intermediate (
false
,false
) is incorrect and is causing issues when using an authentication gate.It is therefore recommended to stop using
useAuthLoading
, and to useuseAuthenticationStatus
instead, in order to keep the loading state and the authentication in sync within the same hook.Usage:
const { isLoading, isAuthenticated } = useAuthenticationStatus()
Fixes this issue