Next.js Discord

Discord Forum

In which file do I wrap SessionProvider in since I don't have _app.jsx ?

Answered
i_lost_to_loba_kreygasm posted this in #help-forum
Open in Discord
Please tell me
Answered by Ray
app/layout.jsx for app router
create pages/_app.jsx if you are using page router
View full answer

14 Replies

@i_lost_to_loba_kreygasm Please tell me
app/layout.jsx for app router
create pages/_app.jsx if you are using page router
Answer
@Ray app/layout.jsx for app router create pages/_app.jsx if you are using page router
i am using app router right ?
@i_lost_to_loba_kreygasm i am using app router right ?
look like you are using both
@Ray look like you are using both
is it bad that I am using both ? how can I use single router ?
@i_lost_to_loba_kreygasm is it bad that I am using both ? how can I use single router ?
you could use both depend on your use case
or only have app folder or pages folder
@Ray I need another help from you
@gin can i help u?
I would love to .
So I have managed to authenticate with google provider , but now I want to store posts based on the user logged in
can you give me any ideas ?
ideas...to store in the DB?
Thrianta
1. store user login info (name,email,profile image) on your database
2. store post with loggedin user email as foreign key
3.fetch post author with that email