-
Notifications
You must be signed in to change notification settings - Fork 67
Feat: Custom OTP PKCE flow + Improve error logging in authentication flow & handle supabase rate-limit error #89
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
Changes from 1 commit
6477b3b
0335a02
5823dac
5fba558
be2549e
c0a0dc0
d26c08b
68ae450
a0abb27
0c7f708
9542b7d
84fd3af
6522680
9daec69
b9e7299
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ import { | |
| shouldWarnAboutAlternateEmail, | ||
| validateEmail, | ||
| } from '@/server/auth/validate-email' | ||
| import { ERROR_CODES } from '@/configs/logs' | ||
|
|
||
| export const signInWithOAuthAction = actionClient | ||
| .schema( | ||
|
|
@@ -171,6 +172,13 @@ export const forgotPasswordAction = actionClient | |
| }) | ||
|
|
||
| if (error) { | ||
| console.error(ERROR_CODES.SUPABASE, 'Error resetting password:', error) | ||
| if (error.message.includes('security purposes')) { | ||
| return returnServerError( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you need to return here?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no, it's just a convenient wrapper i am using because next-safe-action also has |
||
| 'Please wait before requesting another password reset' | ||
| ) | ||
| } | ||
|
|
||
| throw error | ||
| } | ||
| }) | ||
|
|
||
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.
why change from logError > console.error?
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.
the logger is nice when the args do not include a class instance (error in this case). i am about to fix this but in another pr.