-
Notifications
You must be signed in to change notification settings - Fork 213
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
feat(auth): Add Redis caching for pending user registration and implement token verification logic #1181
base: dev
Are you sure you want to change the base?
feat(auth): Add Redis caching for pending user registration and implement token verification logic #1181
Conversation
…ment configuration
…erification responses
Signed-off-by: Mantle Bearer <[email protected]>
Signed-off-by: Mantle Bearer <[email protected]>
Signed-off-by: Mantle Bearer <[email protected]>
…ance verification flow
Signed-off-by: Mantle Bearer <[email protected]>
Signed-off-by: Mantle Bearer <[email protected]>
This might break prod if redis is not set up in other environments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have resolved all the conversation as requested.
Here are the commit messages for you to quickly confirm and approve my PR
-
No longer exposing sensitive credentials in .env.sample 201fc52e74c94951084160b74a95e516b3b0a824
-
I have removed the unused create_registration_access_toke() method in this commit 446c2b85c902bf5438c69cb5d5f7a37c5f1f32b1
-
I replaced the direct Redis client initialization with a lazy-initialization approach
a827a66ac155ec7460f4f925442009ec5b5bea1f
…nd streamline app execution
Add Unit and Integration Tests for Authentication Routes
Description
This PR adds unit tests for the
/register
and/register-super-admin
routes and integration tests for the/verify-token
route. It also includes a mocked Redis client to simulate pending user cache during the verification process.Related Issue (Link to issue ticket) #1010
Motivation and Context
/register
and/register-super-admin
routes handle user and admin registration correctly./verify-token
route processes cached user data from Redis and creates user records in the database.How Has This Been Tested?
/register
)/register-super-admin
)/verify-token
)Screenshots (if appropriate):
Successful user email sent to user
✅ Verification token match (valid token)

❌ Verification token mismatch (invalid token)
Redis CLI output displaying cached user data for both verified and after unverified user

All three tests passed

Types of changes
Checklist: