-
Notifications
You must be signed in to change notification settings - Fork 10
fix(auth): added OTP email template setup and updated verifyOTP() usage #44
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughUpdates authentication docs from magic-link to OTP email flow with a new OTP email template and UI configuration steps; changes Supabase service to trim tokens and always verify using email OTP type, and makes the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant App as Client App
participant Service as Supabase Service
participant Email as Email Provider
User->>App: Request signup/login (email)
App->>Service: Request send OTP
Service->>Email: Send OTP using configured template
Email->>User: Deliver email with 6-digit token
User->>App: Submit email + token
App->>Service: verifyOTP(email, token, type?)
Note right of Service: token trimmed\nalways uses OtpType.email
alt success
Service->>App: success
App->>User: authenticated
else failure
Service->>App: error
App->>User: show error/retry
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–25 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
BACKEND.md(1 hunks)lib/services/supabase_service.dart(2 hunks)
🔇 Additional comments (1)
BACKEND.md (1)
185-263: Excellent documentation for OTP configuration!The authentication setup section provides clear, actionable instructions for configuring email-based OTP authentication. The HTML template is well-designed with appropriate styling, clear OTP display, and includes important security messaging. The step-by-step navigation paths make it easy for developers to configure their Supabase project correctly.
|
Good work @hasanravda ! Can you please add a POW here so that we can wrap this up |
|
@SharkyBytes You mean screen recording ? |
Ell-ena.signup.mp4@SharkyBytes Check this |
|
@hasanravda template and email config looks good, can you also check the reset password functionality in the app! is it working for you now? |
|
@SharkyBytes Yeah I have tested all the cases even reset password, its working and I am getting otp! |
Closes #41
📝 Description
This PR fixes the issue where users were not receiving OTP emails during signup/login verification.
The root cause was a missing or incorrectly configured Supabase email template (Magic Link default instead of OTP template).
It also resolves the recurring
otp_expirederror that occurred when verifying OTPs after receiving them.🔧 Changes Made
supabase_service.dart:✅ Checklist
Summary by CodeRabbit
New Features
Documentation
Improvements