Skip to content
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

Email otp signon user #770

Merged
merged 3 commits into from
Oct 19, 2024
Merged

Email otp signon user #770

merged 3 commits into from
Oct 19, 2024

Conversation

ShivanshPlays
Copy link
Contributor

Description

This PR replaces the password-based authentication system with a secure email OTP sign-on for users. The following changes were made across the backend and frontend to support this new authentication flow:


Changes Made:

  • Added Nodemailer

Configured Nodemailer to handle email delivery using SMTP for sending OTPs.

  • Created lib/nodemailerconfig.tsx

Contains the SMTP configuration required to send emails.

  • Created lib/sendmail.tsx

Implements the email sending logic for dispatching OTPs to users during login/signup.
Modified NextAuth Configuration

  • Updated the authentication provider in nextauth to support OTP-based sign-in.

Removed password verification logic and integrated OTP handling.
Added logic to clear OTP after successful authentication.

  • Updated Prisma Schema

Removed the passwordHash field from the User and Seller models.
Added an otp field to store one-time passwords temporarily.

  • Updated Frontend UI

Added new components and UI flow to support email OTP login/signup.
Integrated Zod validation for the new OTP-based forms.

  • Enhanced Error Handling on Frontend

Implemented full-proof error handling for potential OTP errors during sign-in and signup.
Added proper user feedback for invalid OTPs, expired OTPs, and email input errors.

Testing & Validation:
Verified OTP generation, email delivery, and login flows using valid email addresses.

Related Issues


Screenshots / videos (if applicable)

p1.mp4
p2.mp4

Copy link

vercel bot commented Oct 18, 2024

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

Name Status Preview Comments Updated (UTC)
ezyshopz ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 18, 2024 10:27pm

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, ShivanshPlays, for your contribution! Your pull request has been submitted successfully. A maintainer will review it as soon as possible. We appreciate your support in making Ezyshop better. 🎉

@mdazfar2 mdazfar2 merged commit 669992d into mdazfar2:main Oct 19, 2024
2 checks passed
@mdazfar2
Copy link
Owner

Amazing @ShivanshPlays

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat] modify user signup method: email verification
2 participants