Next-auth(v5) questions
Unanswered
Barbary Lion posted this in #help-forum
Barbary LionOP
Okay so I am using next-auth v5 beta version for login and signup with email. it's currently working but I need to get more idea around it.
my structure is src/app/api/auth/[...nextauth]/route.ts:
src/auth.ts contains logic for login and signup
1) env variables: I am using neo4j data base, I saved variable without NEXT_PUBLIC, how can I use it? what's the right way to get them>(currently exporting through config)
2)how to define difference b/w signup and login, in signup I am POSTing full name, email and password and in login it will be email and password, I want to get same user id and respective session with it. how?
3) also in signup user I am throwing error if email is already in use, but it isn't directly captured in signup page, Do I need to use state management here?
4) bcrpyt is showing error, do I need to use another has for password? which?
5)If I want to add google login(0Auth) with it, how to save that email on my database? so it would be easy for user to login and I get user data in my database
6)Now, depend upon user, I will need to define certain roles, and pages should be shown on based on roles, what is best way to approach this?
7) how to add email verification? and easy way to do it?
my structure is src/app/api/auth/[...nextauth]/route.ts:
import { handlers } from '@/auth';
export const { GET, POST } = handlers;
src/auth.ts contains logic for login and signup
1) env variables: I am using neo4j data base, I saved variable without NEXT_PUBLIC, how can I use it? what's the right way to get them>(currently exporting through config)
2)how to define difference b/w signup and login, in signup I am POSTing full name, email and password and in login it will be email and password, I want to get same user id and respective session with it. how?
3) also in signup user I am throwing error if email is already in use, but it isn't directly captured in signup page, Do I need to use state management here?
4) bcrpyt is showing error, do I need to use another has for password? which?
5)If I want to add google login(0Auth) with it, how to save that email on my database? so it would be easy for user to login and I get user data in my database
6)Now, depend upon user, I will need to define certain roles, and pages should be shown on based on roles, what is best way to approach this?
7) how to add email verification? and easy way to do it?