#Authentication with aws amplify without using UI component with app router (next js 14)

17 messages · Page 1 of 1 (latest)

pseudo ibex
#

I have a problem on how to make the authentication with the app router and aws amplify.

magic chasmBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

foggy estuary
pseudo ibex
foggy estuary
pseudo ibex
# foggy estuary you can add this (see attached) to your global provider. The global provider is ...

Yes I did all those steps. At the. I have already existing ressources so I filled the infos with Amplify.configure({'my data here'}). Now for the logic., I wrapped my root layout with <Authenticator> This works perfectly. I have authentication in the whole app but I don't have the ability to like make a custom page login or signup and make a flow where if the user is not connected to be redirected to login etc..

foggy estuary
#

but I don't have the ability to like make a custom page login or signup and make a flow

When using the Authenticator component from amplify you are not able to create a custom workflow. Of course you can change the visual part (see here) but not the functional (flow) part. So either rely on the authenticator and have no custom flow or create your own custom flow with the javascript library

pseudo ibex
#

Okay so I guess I use jotai or context to have a auth state. If not authenticated , redirect to login and then I create my custom forms to auth with amplify functions right ?

#

But the problem that occurs with that is that if I try to access a page, I see the page for 1s before getting redirected to login page

foggy estuary
foggy estuary
pseudo ibex
#

Sorry for noob question but what is exactly a middleware. Is that the contxt ?

foggy estuary
pseudo ibex
#

Ok thanks I will check that

magic chasmBOT
#
✅ Success!

This question has been marked as answered! If you have any other questions, feel free to create another post

Jump to answer
foggy estuary
pseudo ibex
#

It seems that when I put the getcurrentuser in the middle ware, It tells me Auth UserPool not configured but it is configured in the Layout of the route