-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(auth): Added InvalidDynamicLinkDomain Error Code (#167)
* feat(auth): Added InvalidDynamicLinkDomain error code * Removed incorrect conditional in release workflow
- Loading branch information
1 parent
d9ca03c
commit c6b8bba
Showing
4 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
using FirebaseAdmin.Tests; | ||
|
@@ -321,6 +322,35 @@ public async Task SignInWithEmailLinkUnexpectedResponse() | |
Assert.Null(exception.InnerException); | ||
} | ||
|
||
[Fact] | ||
public async Task InvalidDynamicLinkDomain() | ||
{ | ||
var json = $@"{{ | ||
""error"": {{ | ||
""message"": ""INVALID_DYNAMIC_LINK_DOMAIN"", | ||
}} | ||
}}"; | ||
var handler = new MockMessageHandler() | ||
{ | ||
StatusCode = HttpStatusCode.InternalServerError, | ||
Response = json, | ||
}; | ||
var auth = this.CreateFirebaseAuth(handler); | ||
|
||
var exception = await Assert.ThrowsAsync<FirebaseAuthException>( | ||
async () => await auth.GenerateSignInWithEmailLinkAsync( | ||
"[email protected]", ActionCodeSettings)); | ||
|
||
Assert.Equal(ErrorCode.InvalidArgument, exception.ErrorCode); | ||
Assert.Equal(AuthErrorCode.InvalidDynamicLinkDomain, exception.AuthErrorCode); | ||
Assert.Equal( | ||
"Dynamic link domain specified in ActionCodeSettings is not authorized " | ||
+ "(INVALID_DYNAMIC_LINK_DOMAIN).", | ||
exception.Message); | ||
Assert.NotNull(exception.HttpResponse); | ||
Assert.Null(exception.InnerException); | ||
} | ||
|
||
private FirebaseAuth CreateFirebaseAuth(HttpMessageHandler handler) | ||
{ | ||
var userManager = new FirebaseUserManager(new FirebaseUserManager.Args | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters