@@ -132,13 +132,13 @@ public async Task<FirebaseAuthLink> SignInWithGoogleIdTokenAsync(string idToken)
132
132
var content = $ "{{\" postBody\" :\" id_token={ idToken } &providerId={ providerId } \" ,\" requestUri\" :\" http://localhost\" ,\" returnSecureToken\" :true}}";
133
133
134
134
return await this . ExecuteWithPostContentAsync ( GoogleIdentityUrl , content ) . ConfigureAwait ( false ) ;
135
- }
135
+ }
136
136
137
- /// <summary>
138
- /// Sign in user anonymously. He would still have a user id and access token generated, but name and other personal user properties will be null.
139
- /// </summary>
140
- /// <returns> The <see cref="FirebaseAuth"/>. </returns>
141
- public async Task < FirebaseAuthLink > SignInAnonymouslyAsync ( )
137
+ /// <summary>
138
+ /// Sign in user anonymously. He would still have a user id and access token generated, but name and other personal user properties will be null.
139
+ /// </summary>
140
+ /// <returns> The <see cref="FirebaseAuth"/>. </returns>
141
+ public async Task < FirebaseAuthLink > SignInAnonymouslyAsync ( )
142
142
{
143
143
var content = $ "{{\" returnSecureToken\" :true}}";
144
144
@@ -543,9 +543,6 @@ private static AuthErrorReason GetFailureReason(string responseData)
543
543
break ;
544
544
545
545
//possible errors from Email/Password Account Signup (via signupNewUser or setAccountInfo)
546
- case "WEAK_PASSWORD : Password should be at least 6 characters" :
547
- failureReason = AuthErrorReason . WeakPassword ;
548
- break ;
549
546
case "EMAIL_EXISTS" :
550
547
failureReason = AuthErrorReason . EmailExists ;
551
548
break ;
@@ -565,9 +562,6 @@ private static AuthErrorReason GetFailureReason(string responseData)
565
562
case "USER_DISABLED" :
566
563
failureReason = AuthErrorReason . UserDisabled ;
567
564
break ;
568
- case "TOO_MANY_ATTEMPTS_TRY_LATER" :
569
- failureReason = AuthErrorReason . TooManyAttemptsTryLater ;
570
- break ;
571
565
572
566
//possible errors from Email/Password Signin or Password Recovery or Email/Password Sign up using setAccountInfo
573
567
case "MISSING_EMAIL" :
@@ -598,6 +592,14 @@ private static AuthErrorReason GetFailureReason(string responseData)
598
592
failureReason = AuthErrorReason . AlreadyLinked ;
599
593
break ;
600
594
}
595
+
596
+ if ( failureReason == AuthErrorReason . Undefined )
597
+ {
598
+ //possible errors from Email/Password Account Signup (via signupNewUser or setAccountInfo)
599
+ if ( errorData ? . error ? . message ? . StartsWith ( "WEAK_PASSWORD :" ) ?? false ) failureReason = AuthErrorReason . WeakPassword ;
600
+ //possible errors from Email/Password Signin
601
+ else if ( errorData ? . error ? . message ? . StartsWith ( "TOO_MANY_ATTEMPTS_TRY_LATER :" ) ?? false ) failureReason = AuthErrorReason . TooManyAttemptsTryLater ;
602
+ }
601
603
}
602
604
}
603
605
catch ( JsonReaderException )
0 commit comments