File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import {
2323} from '../../lib/betterAuth' ;
2424import {
2525 getSocialAuthCallbackError ,
26+ GITHUB_EMAIL_NOT_VERIFIED_ERROR ,
2627 hasSocialAuthBootUser ,
2728 refetchSocialAuthBoot ,
2829 SOCIAL_AUTH_RETRY_MESSAGE ,
@@ -393,6 +394,10 @@ function AuthOptionsInner({
393394 const callbackError = getSocialAuthCallbackError ( e ?. data ) ;
394395 const callbackData =
395396 typeof e ?. data === 'object' ? JSON . stringify ( e . data ) : undefined ;
397+ const socialErrorMessage =
398+ callbackError === GITHUB_EMAIL_NOT_VERIFIED_ERROR
399+ ? labels . auth . error . githubEmailNotVerified
400+ : SOCIAL_AUTH_RETRY_MESSAGE ;
396401
397402 let boot ;
398403 try {
@@ -414,7 +419,7 @@ function AuthOptionsInner({
414419 } ) ,
415420 } ) ;
416421 if ( ! authFlowSucceededRef . current ) {
417- displayToast ( SOCIAL_AUTH_RETRY_MESSAGE ) ;
422+ displayToast ( socialErrorMessage ) ;
418423 }
419424 return ;
420425 }
@@ -436,7 +441,7 @@ function AuthOptionsInner({
436441 } ) ,
437442 } ) ;
438443 if ( ! authFlowSucceededRef . current ) {
439- displayToast ( SOCIAL_AUTH_RETRY_MESSAGE ) ;
444+ displayToast ( socialErrorMessage ) ;
440445 }
441446 return ;
442447 }
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ import type { Boot } from '../../lib/boot';
33export const SOCIAL_AUTH_RETRY_MESSAGE =
44 "We couldn't complete your social sign-in. Please try again." ;
55
6+ export const GITHUB_EMAIL_NOT_VERIFIED_ERROR = 'github_email_not_verified' ;
7+
68const SOCIAL_AUTH_BOOT_RETRY_DELAYS_MS = [ 0 , 250 , 750 ] as const ;
79
810type BootUser = Partial < Boot > [ 'user' ] ;
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ export const labels = {
2626 '❌ We ran into an unexpected error on our end. Please try again.' ,
2727 existingEmail :
2828 'That email is linked to a different sign-in method. Please try another provider.' ,
29+ githubEmailNotVerified :
30+ 'Your GitHub email address is not verified. Please verify it on GitHub and try again.' ,
2931 } ,
3032 } ,
3133 referral : {
You can’t perform that action at this time.
0 commit comments