File tree Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,6 @@ jobs:
100
100
name : Release
101
101
102
102
- name : Setup .NET Core
103
- if : matrix.os == 'ubuntu-latest'
104
103
uses : actions/setup-dotnet@v1
105
104
with :
106
105
dotnet-version : 2.2.108
Original file line number Diff line number Diff line change 15
15
using System ;
16
16
using System . Collections . Generic ;
17
17
using System . Linq ;
18
+ using System . Net ;
18
19
using System . Net . Http ;
19
20
using System . Threading . Tasks ;
20
21
using FirebaseAdmin . Tests ;
@@ -321,6 +322,35 @@ public async Task SignInWithEmailLinkUnexpectedResponse()
321
322
Assert . Null ( exception . InnerException ) ;
322
323
}
323
324
325
+ [ Fact ]
326
+ public async Task InvalidDynamicLinkDomain ( )
327
+ {
328
+ var json = $@ "{{
329
+ ""error"": {{
330
+ ""message"": ""INVALID_DYNAMIC_LINK_DOMAIN"",
331
+ }}
332
+ }}" ;
333
+ var handler = new MockMessageHandler ( )
334
+ {
335
+ StatusCode = HttpStatusCode . InternalServerError ,
336
+ Response = json ,
337
+ } ;
338
+ var auth = this . CreateFirebaseAuth ( handler ) ;
339
+
340
+ var exception = await Assert . ThrowsAsync < FirebaseAuthException > (
341
+ async ( ) => await auth . GenerateSignInWithEmailLinkAsync (
342
+ "[email protected] " , ActionCodeSettings ) ) ;
343
+
344
+ Assert . Equal ( ErrorCode . InvalidArgument , exception . ErrorCode ) ;
345
+ Assert . Equal ( AuthErrorCode . InvalidDynamicLinkDomain , exception . AuthErrorCode ) ;
346
+ Assert . Equal (
347
+ "Dynamic link domain specified in ActionCodeSettings is not authorized "
348
+ + "(INVALID_DYNAMIC_LINK_DOMAIN)." ,
349
+ exception . Message ) ;
350
+ Assert . NotNull ( exception . HttpResponse ) ;
351
+ Assert . Null ( exception . InnerException ) ;
352
+ }
353
+
324
354
private FirebaseAuth CreateFirebaseAuth ( HttpMessageHandler handler )
325
355
{
326
356
var userManager = new FirebaseUserManager ( new FirebaseUserManager . Args
Original file line number Diff line number Diff line change @@ -58,5 +58,10 @@ public enum AuthErrorCode
58
58
/// No user record found for the given identifier.
59
59
/// </summary>
60
60
UserNotFound ,
61
+
62
+ /// <summary>
63
+ /// Dynamic link domain specified in <see cref="ActionCodeSettings"/> is not authorized.
64
+ /// </summary>
65
+ InvalidDynamicLinkDomain ,
61
66
}
62
67
}
Original file line number Diff line number Diff line change @@ -56,6 +56,13 @@ internal sealed class AuthErrorHandler
56
56
AuthErrorCode . EmailAlreadyExists ,
57
57
"The user with the provided email already exists" )
58
58
} ,
59
+ {
60
+ "INVALID_DYNAMIC_LINK_DOMAIN" ,
61
+ new ErrorInfo (
62
+ ErrorCode . InvalidArgument ,
63
+ AuthErrorCode . InvalidDynamicLinkDomain ,
64
+ "Dynamic link domain specified in ActionCodeSettings is not authorized" )
65
+ } ,
59
66
{
60
67
"PHONE_NUMBER_EXISTS" ,
61
68
new ErrorInfo (
You can’t perform that action at this time.
0 commit comments