useLogin and useAuth do not work together to update isAuthenticated
/viewer
#1923
Labels
needs: reproduction
This issue needs to be reproduced independently
Description
In this example code I'm trying to login the user with
useLogin
and then wait to see them become authenticated by usinguseAuth
. I can confirm after login that a cookie is created in the browser and I see a GET request completed to urlhttp://localhost:3000/api/faust/auth/token?code=1PrSDHzvYuNSANI47ZiP%2BvyRwEbQ8eihr7rq5gI3fpok%2FXY%2FP%2BwsJovxj4aW3tYHmE1PFLx%2FC%2BjnxwJo8TiUvg%3D%3D
with output like this:Furthermore, I can soft refresh the browser page and if I were to console.log
viewer
fromuseAuth
on the next page load then it would recognize the logged in user. So I know that it's successfully logging me in as the user.The issue is that
useAuth
is never updating eitherisAuthenticated
orviewer
right after a successfullogin()
withuseLogin
. Here is the Next.js component that demonstrates how I'm trying to get access toisAuthenticated
after successful login:What happens instead is that it will wait forever for
isAuthenticated
(orviewer
) to change, logging 'Checking authentication status...' to the console every second, but it never changes.Steps to reproduce
See description
Additional context
No response
@faustwp/core Version
^3.0.1
@faustwp/cli Version
^3.0.2
FaustWP Plugin Version
1.3.2
WordPress Version
6.6.1
Additional environment details
No response
Please confirm that you have searched existing issues in the repo.
The text was updated successfully, but these errors were encountered: