File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,7 @@ fireauth.authenum.Error = {
147
147
INVALID_PASSWORD : 'wrong-password' ,
148
148
INVALID_PERSISTENCE : 'invalid-persistence-type' ,
149
149
INVALID_PHONE_NUMBER : 'invalid-phone-number' ,
150
+ INVALID_PROVIDER_ID : 'invalid-provider-id' ,
150
151
INVALID_RECIPIENT_EMAIL : 'invalid-recipient-email' ,
151
152
INVALID_SENDER : 'invalid-sender' ,
152
153
INVALID_SESSION_INFO : 'invalid-verification-id' ,
@@ -294,6 +295,8 @@ fireauth.AuthError.MESSAGES_[fireauth.authenum.Error.INVALID_PHONE_NUMBER] =
294
295
'phone number in a format that can be parsed into E.164 format. E.164 ' +
295
296
'phone numbers are written in the format [+][country code][subscriber ' +
296
297
'number including area code].' ;
298
+ fireauth . AuthError . MESSAGES_ [ fireauth . authenum . Error . INVALID_PROVIDER_ID ] =
299
+ 'The specified provider ID is invalid.' ;
297
300
fireauth . AuthError . MESSAGES_ [ fireauth . authenum . Error . INVALID_RECIPIENT_EMAIL ] =
298
301
'The email corresponding to this action failed to send as the provided ' +
299
302
'recipient email address is invalid.' ;
Original file line number Diff line number Diff line change @@ -207,6 +207,7 @@ fireauth.RpcHandler.ServerError = {
207
207
INVALID_OOB_CODE : 'INVALID_OOB_CODE' ,
208
208
INVALID_PASSWORD : 'INVALID_PASSWORD' ,
209
209
INVALID_PHONE_NUMBER : 'INVALID_PHONE_NUMBER' ,
210
+ INVALID_PROVIDER_ID : 'INVALID_PROVIDER_ID' ,
210
211
INVALID_RECIPIENT_EMAIL : 'INVALID_RECIPIENT_EMAIL' ,
211
212
INVALID_SENDER : 'INVALID_SENDER' ,
212
213
INVALID_SESSION_INFO : 'INVALID_SESSION_INFO' ,
@@ -2244,6 +2245,10 @@ fireauth.RpcHandler.getDeveloperError_ =
2244
2245
errorMap [ fireauth . RpcHandler . ServerError . MISSING_OOB_CODE ] =
2245
2246
fireauth . authenum . Error . INTERNAL_ERROR ;
2246
2247
2248
+ // Get Auth URI errors:
2249
+ errorMap [ fireauth . RpcHandler . ServerError . INVALID_PROVIDER_ID ] =
2250
+ fireauth . authenum . Error . INVALID_PROVIDER_ID ;
2251
+
2247
2252
// Operations that require ID token in request:
2248
2253
errorMap [ fireauth . RpcHandler . ServerError . CREDENTIAL_TOO_OLD_LOGIN_AGAIN ] =
2249
2254
fireauth . authenum . Error . CREDENTIAL_TOO_OLD_LOGIN_AGAIN ;
Original file line number Diff line number Diff line change @@ -5268,6 +5268,30 @@ function testGetAuthUri_success() {
5268
5268
}
5269
5269
5270
5270
5271
+ /**
5272
+ * Tests server side getAuthUri error.
5273
+ */
5274
+ function testGetAuthUri_caughtServerError ( ) {
5275
+ var expectedUrl = 'https://www.googleapis.com/identitytoolkit/v3/relyin' +
5276
+ 'gparty/createAuthUri?key=apiKey' ;
5277
+ var requestBody = {
5278
+ 'providerId' : 'abc.com' ,
5279
+ 'continueUri' : 'http://localhost/widget' ,
5280
+ 'customParameter' : { }
5281
+ } ;
5282
+ var errorMap = { } ;
5283
+ // All related server errors for getAuthUri.
5284
+ errorMap [ fireauth . RpcHandler . ServerError . INVALID_PROVIDER_ID ] =
5285
+ fireauth . authenum . Error . INVALID_PROVIDER_ID ;
5286
+
5287
+ assertServerErrorsAreHandled ( function ( ) {
5288
+ return rpcHandler . getAuthUri (
5289
+ 'abc.com' ,
5290
+ 'http://localhost/widget' ) ;
5291
+ } , errorMap , expectedUrl , requestBody ) ;
5292
+ }
5293
+
5294
+
5271
5295
/**
5272
5296
* Tests successful getAuthUri request with Google provider and sessionId.
5273
5297
*/
You can’t perform that action at this time.
0 commit comments