-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Using Authenticator with App Router #4905
Comments
Hi @zvictor, |
Oh, you are right! I didn't remember setting up Anyway, the content of my the bug description has been updated to include this info |
@zvictor Can you clarify how you are trying to use |
@zvictor Following up here to say that our Next.js App Router (Server Components) guide has been published. Did you have any further questions? |
Closing this out as we haven't heard back. Please open a new issue if you are still having trouble with App Router. |
Before creating a new issue, please confirm:
On which framework/platform are you having an issue?
React
Which UI component?
Authenticator
How is your app built?
Next.js
What browsers are you seeing the problem on?
Chrome, Firefox
Please describe your bug.
Note: Similar issues have been reported before, but I believe there are important nuances on this one.
While using the
<Authenticator>
component (as a wrapper of my App) to setup Amplify in the new Nextjs app router, I could notice that logged in users would sometimes be mistakenly redirected to/sign-in
but been shown a 404 page instead of the signInUp form.I did some debugging and could notice that
useAuthenticator
is returningidle
asroute
.amplify-ui/packages/react/src/components/Authenticator/Router/Router.tsx
Line 61 in c021e49
@ErikCH commented on a similar issue:
What's the expected behaviour?
/sign-in
/sign-in
Help us reproduce the bug!
middleware.ts
as defined at the Server-Side Rendering guideAuthenticator
to/app/providers.tsx
, as shown below:Once that is done you should notice the problem reported as long as you try navigating and reloading the pages while logged in.
Code Snippet
Related to
useAuthenticator
Hook #1497The text was updated successfully, but these errors were encountered: