Can I build an authentication package/app to share user data and auth across all apps? #825
-
I am building a turborepo with four Next.js apps that all require user login and authentication. I am using Prisma with Postgres and Next Auth for authentication and I would like to build one auth app that handles all authentication. Basically, a custom wrapper for Next Auth that takes in a redirect callback URL and redirects the user to that URL after being authenticated. Are there any examples or resources to do this? I this wrapper could and should probably be a custom express server that takes these params and creates the necessary Next Auth redirect. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I don't understand what this has to do with Turborepo. Yes, you can build any package you want and have Turborepo build it. |
Beta Was this translation helpful? Give feedback.
-
Yes you can build an authentication service package, and share data with any package you want, exporting it from your new auth workstation, and declaring in your app package with --> "": "*" |
Beta Was this translation helpful? Give feedback.
Yes you can build an authentication service package, and share data with any package you want, exporting it from your new auth workst…