Skip to content

implement node redis adapter #13164

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

lengerrong
Copy link

☕️ Reasoning
This PR adds a new Node Redis adapter for NextAuth, enabling developers to use Redis as a storage backend for sessions, users, accounts, and verification tokens. The adapter implements the official NextAuth Adapter interface and includes comprehensive tests to ensure compatibility. This expands NextAuth’s supported databases and helps users who want a lightweight, fast Redis solution.

🧢 Checklist
Documentation — Added README with usage and configuration instructions

Tests — Implemented adapter tests using NextAuth’s adapter test harness

Ready to be merged — Fully functional, tested, and follows NextAuth contribution guidelines

🎫 Affected issues
It’s a new adapter feature, so no existing issues are directly closed by this PR.

📌 Resources
Security guidelines

Contributing guidelines

Code of conduct

Contributing to Open Source

Copy link

vercel bot commented Aug 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ❌ Failed (Inspect) Aug 8, 2025 9:27pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Aug 8, 2025 9:27pm

Copy link

vercel bot commented Aug 8, 2025

Someone is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the adapters Changes related to the core code concerning database adapters label Aug 8, 2025
@lengerrong
Copy link
Author

pnpm test --filter @auth/node-redis-adapter

@auth/[email protected] test /Users/eleng/Work/next-auth/packages/adapter-node-redis
./test/test.sh

Initializing container for Node-Redis tests
[+] Running 1/1
✔ redis Pulled 2.8s
[+] Running 2/2
✔ Network adapter-node-redis_default Created 0.0s
✔ Container adapter-node-redis-redis-1 Started 0.1s
Waiting 5s for db to start...

RUN v1.2.2 /Users/eleng/Work/next-auth/packages/adapter-node-redis
Coverage enabled with v8

stdout | src/utils.ts:31:13
Connected to Redis

✓ test/index.test.ts (22)
✓ Required (User, Account, Session) methods exist
✓ createUser
✓ getUser
✓ getUserByEmail
✓ createSession
✓ getSessionAndUser
✓ updateUser
✓ updateSession
✓ linkAccount
✓ getUserByAccount
✓ deleteSession
✓ Verification Token methods exist
✓ createVerificationToken
✓ useVerificationToken
✓ Future methods exist
✓ unlinkAccount
✓ deleteUser
↓ getAccount [skipped]
↓ createAuthenticator [skipped]
↓ getAuthenticator [skipped]
↓ listAuthenticatorsByUserId [skipped]
↓ updateAuthenticatorCounter [skipped]

Test Files 1 passed (1)
Tests 17 passed | 5 skipped (22)
Start at 14:26:21
Duration 2.43s (transform 184ms, setup 37ms, collect 1.94s, tests 29ms, environment 0ms, prepare 243ms)

[+] Running 2/2
✔ Container adapter-node-redis-redis-1 Removed 0.2s
✔ Network adapter-node-redis_default Removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapters Changes related to the core code concerning database adapters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant