Session Auth using Redis and next-session
Hey everyone,
This is more of a resource than a question, but I wanted to share an elegant approach to session auth within NextJS (in my opinion).
Personally, I've not had a great time using Next-Auth since most projects I'm involved with use credential-based auth. I find Next-Auth is a bit too opinionated for my liking and requires a certain database structure. That, and I'm not too fond of JWTs. After doing some research, I stumbled across next-session, which allows you to create a custom session store. The next-session docs are clear and concise and helped me create a custom session store with Redis (using ioredis). I just wanted to share this solution, since this is something I've been looking for for some time. I hope this is able to help at least a few of you. Cheers! next-session docs: https://github.com/hoangvvo/next-session redis-next-session repo: https://github.com/nick-cheatwood7/redis-next-session
Personally, I've not had a great time using Next-Auth since most projects I'm involved with use credential-based auth. I find Next-Auth is a bit too opinionated for my liking and requires a certain database structure. That, and I'm not too fond of JWTs. After doing some research, I stumbled across next-session, which allows you to create a custom session store. The next-session docs are clear and concise and helped me create a custom session store with Redis (using ioredis). I just wanted to share this solution, since this is something I've been looking for for some time. I hope this is able to help at least a few of you. Cheers! next-session docs: https://github.com/hoangvvo/next-session redis-next-session repo: https://github.com/nick-cheatwood7/redis-next-session
GitHub
GitHub - hoangvvo/next-session: Simple promise-based session middle...
Simple promise-based session middleware for Next.js, micro, Express, and more - GitHub - hoangvvo/next-session: Simple promise-based session middleware for Next.js, micro, Express, and more
GitHub
GitHub - nick-cheatwood7/redis-next-session
Contribute to nick-cheatwood7/redis-next-session development by creating an account on GitHub.
0 Replies