NextJS Mongoose & Next-Auth Help
Unanswered
West African Lion posted this in #help-forum
West African LionOP
Hey! 👋
I've been testing for the past 8 hours on how to implement Next-Auth using Mongoose (credentials provider). However, I've noticed there are numerous compatibility issues (like being forced to implement NextAuth as a route) and implementation variations (different API Structures, Calls etc).
I wanted to ask if someone would be so kind as to help me implement missing features and fix my template while still keeping it kinda in the same schema.
My template includes a simple main page, login, register, and dashboard (in JavaScript, not TypeScript).
Currently, I'm facing the following issues:
- Despite renaming the user saved in the database, NextAuth still thinks I'm logged in and considers it valid.
- I have concerns about the way I've implemented NextAuth.
- Understanding in how to correctly implement checking whether the User is logged in and valid. (ServerSideProps?)
With "missing features", I meant possible security concerns.
This is my first time using NextAuth and I'm also kind of new to NextJS (Only made some small projects), so it would be amazing if anyone could help me refine my template and teach me where I might be going wrong.
I will most likely later once I feel like it's completed publish it to GitHub, since I couldn't find anything that matches the latest standards and has a good structure.
The best I could find was:
https://github.com/Parth731/nextjs-credentials/tree/master
https://github.com/spruceid/siwe-next-auth-example/tree/main (Javascript Implementation and outdated)
https://github.com/vercel/next.js/tree/canary/examples/with-mongodb-mongoose (not a NextAuth implementation)
I've been testing for the past 8 hours on how to implement Next-Auth using Mongoose (credentials provider). However, I've noticed there are numerous compatibility issues (like being forced to implement NextAuth as a route) and implementation variations (different API Structures, Calls etc).
I wanted to ask if someone would be so kind as to help me implement missing features and fix my template while still keeping it kinda in the same schema.
My template includes a simple main page, login, register, and dashboard (in JavaScript, not TypeScript).
Currently, I'm facing the following issues:
- Despite renaming the user saved in the database, NextAuth still thinks I'm logged in and considers it valid.
- I have concerns about the way I've implemented NextAuth.
- Understanding in how to correctly implement checking whether the User is logged in and valid. (ServerSideProps?)
With "missing features", I meant possible security concerns.
This is my first time using NextAuth and I'm also kind of new to NextJS (Only made some small projects), so it would be amazing if anyone could help me refine my template and teach me where I might be going wrong.
I will most likely later once I feel like it's completed publish it to GitHub, since I couldn't find anything that matches the latest standards and has a good structure.
The best I could find was:
https://github.com/Parth731/nextjs-credentials/tree/master
https://github.com/spruceid/siwe-next-auth-example/tree/main (Javascript Implementation and outdated)
https://github.com/vercel/next.js/tree/canary/examples/with-mongodb-mongoose (not a NextAuth implementation)
17 Replies
West African LionOP
If anyone got any further Questions, ofc feel free to ask me (please ping me for questions/answers if possible)
West African LionOP
bump
West African LionOP
No one wants to help me? :(
@West African Lion No one wants to help me? \:(
sure, let me see the issue
@West African Lion Here are 3 things for you to note:
- Nobody would do a major work for you for free
- This server is not for hiring people
- No one can help you completely, They can just guide you on how to fix.
- Nobody would do a major work for you for free
- This server is not for hiring people
- No one can help you completely, They can just guide you on how to fix.
@Anay-208 <@148739198721982465> Here are 3 things for you to note:
- ** Nobody would do a major work for you for free **
- ** This server is not for hiring people **
- ** No one can help you completely, They can just guide you on how to fix.**
West African LionOP
It‘s not major work, I just wanted someone to look over it and either tell me how I can do it or give me an example
I also didn‘t plan on hiring people.
I also didn‘t plan on hiring people.
But okay… I though this server could help me more.
Send the code
West African LionOP
Because the zip file includes all the code
If you read my message, it doesn‘t say I have one specific issue
We just need it in a message
West African LionOP
Well I am unsure what File might be needed for it...
@West African Lion Well I am unsure what File might be needed for it...
Just send code in message
@Anay-208 Just send code in message
West African LionOP
You want me to send all the 26 files in a message?
@West African Lion You want me to send all the 26 files in a message?
only send the part of code you’ve problem in. One can be solved and solution can be applied to other parts also