implement discord-like account switching

I want the user to be able to sign in with multiple accounts, then switch between them similar to how you switch account in discord. However, I could not find any information on how to implement this with next-auth (or just implementing it in general). How can I implement this? Tysm in advance! For additional context, I am using appdir, and there is an external server that I will be authenticating against, which returns me a JWT when the user signs in (me sending them a request with username & password). This server is outside of my control.
5 Replies
cornflour
cornflour17mo ago
bump
benten
benten17mo ago
whats the blocker here for you?
cornflour
cornflour17mo ago
so im stuck at how to set it up such that i got the list of sessions (each having a jwt + maybe some other user info) from the accounts the user has signed in and the ability to swap between these sessions i have only ever set up next auth to sign in and then sign out, so im kinda lost at how account switching would work
Liam
Liam17mo ago
Have not looked through this but might be worth checking out? https://dev.to/oreoluwabs/building-an-account-switcher-with-nextjs-and-next-auth-5cnf
DEV Community
Building an Account switcher with NextJS and Next Auth
This article delves into the step-by-step process of integrating NextAuth into a Next.js application,...
cornflour
cornflour17mo ago
i'll check it out!
Want results from more Discord servers?
Add your server