New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redis adapter #544
Comments
Following the documentation, you should be able to connect to redis as below; // pages/api/auth/[...nextauth].js
import NextAuth from 'next-auth'
import Providers from 'next-auth/providers'
const options = {
// OAuth Service Providers and other details
// Provide URL to redis to connect (here, from .env file)
database: process.env.DATABASE_URL
}
export default (req, res) => NextAuth(req, res, options)
You may want to check |
Build custom adapter with the same mechanics as as the 'default' adapter Provide 'backwards' compatibility with current implementation
MySQL, Postgres, Microsoft SQL Server and MongoDB are supported. If you want to use a Redis database you would need to write your own adapter. Redis would be a really unconventional choice in a context like this and not something support is planned for. |
Sorry |
Isn't storing sessions in Redis a good idea? https://stackoverflow.com/a/9153199/10854888 |
@nikitapilgrim Did you get anywhere with this? Care to share your solution, pretty please? |
You can use that one https://github.com/quanhua92/next-auth-ioredis-adapter-example/blob/main/lib/IORedisAdapter.ts |
Hi, don't you have an example of connecting a redis as a database?
The text was updated successfully, but these errors were encountered: