这是indexloc提供的服务,不要输入任何密码
Skip to content

feat(auth): Update ActionCodeSettings to support LinkDomain and deprecate DynamicLinkDomain #703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

graeme-verticalscope
Copy link

Discussion

Add the LinkDomain field to the ActionCodeSettings struct, this new field enables migrating off of firebase dynamic links, which is deprecated and will be unsupported soon.

See #681, I was asked to create a second PR targeting master branch. Original PR is #682

Copy link

@Xiaoshouzi-gh Xiaoshouzi-gh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together!

@lahirumaramba lahirumaramba self-assigned this Jul 8, 2025
@lahirumaramba lahirumaramba changed the title Add LinkDomain to ActionCodeSettings feat(auth): Add LinkDomain to ActionCodeSettings Jul 8, 2025
@lahirumaramba lahirumaramba changed the base branch from master to dev July 8, 2025 16:31
@lahirumaramba
Copy link
Member

Thanks for the contribution! The base branch for PRs should be pointed to dev (I just changed it here), please update the feature branch and let me know if you run into any issues.

@graeme-verticalscope
Copy link
Author

I guess you'll want to close either this PR or #682. I had originally created a PR targeting dev, but was recently asked to make one targeting master

@Xiaoshouzi-gh
Copy link

I guess you'll want to close either this PR or #682. I had originally created a PR targeting dev, but was recently asked to make one targeting master

Approved #682 too.

@jonathanedey jonathanedey self-requested a review July 17, 2025 17:59
Copy link
Contributor

@jonathanedey jonathanedey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @graeme-verticalscope, thanks for getting started on this.

Can you add some error logic similar for what we have for dynamicLinkDomain:

invalidDynamicLinkDomain = "INVALID_DYNAMIC_LINK_DOMAIN"

For invalidHostingLinkDomain the backend error should be "INVALID_HOSTING_LINK_DOMAIN"

// IsInvalidDynamicLinkDomain checks if the given error was due to an invalid dynamic link domain.
func IsInvalidDynamicLinkDomain(err error) bool {
return hasAuthErrorCode(err, invalidDynamicLinkDomain)
}

"INVALID_DYNAMIC_LINK_DOMAIN": {
code: internal.InvalidArgument,
message: "the provided dynamic link domain is not configured or authorized for the current project",
authCode: invalidDynamicLinkDomain,
},

Also ensure these are included in our tests:

"INVALID_DYNAMIC_LINK_DOMAIN": {
IsInvalidDynamicLinkDomain,
errorutils.IsInvalidArgument,
"the provided dynamic link domain is not configured or authorized for the current project",
},

cases := map[string]func(error) bool{
"UNAUTHORIZED_DOMAIN": IsUnauthorizedContinueURI,
"INVALID_DYNAMIC_LINK_DOMAIN": IsInvalidDynamicLinkDomain,
}

Thanks!

@graeme-verticalscope
Copy link
Author

@jonathanedey, thanks I added the error code you mentioned!

You may want to check that the code and message are correct here:

	"INVALID_HOSTING_LINK_DOMAIN": {
		code:     internal.InvalidArgument,
		message:  "the provided hosting link domain is not configured or authorized for the current project",
		authCode: invalidHostingLinkDomain,
	},

I used the same code and a similar message to the existing dynamic link error mapping.

Copy link
Contributor

@jonathanedey jonathanedey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one change, thanks!

auth/user_mgt.go Outdated
@@ -1447,6 +1453,11 @@ var serverError = map[string]*authError{
message: "the provided dynamic link domain is not configured or authorized for the current project",
authCode: invalidDynamicLinkDomain,
},
"INVALID_HOSTING_LINK_DOMAIN": {
code: internal.InvalidArgument,
message: "the provided hosting link domain is not configured or authorized for the current project",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call out, lets go with the following to match the node sdk:

the provided hosting link domain is not configured in Firebase Hosting or is not owned by the current project

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I updated the error message.

Copy link

@egilmorez egilmorez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG with possible nit, thanks!

@graeme-verticalscope
Copy link
Author

Let me know if there's anything else I need to do, otherwise I'm assuming this can be approved and merged by a repository maintainer :)

@jonathanedey jonathanedey changed the title feat(auth): Add LinkDomain to ActionCodeSettings feat(auth): Update ActionCodeSettings to support LinkDomain and deprecate DynamicLinkDomain Jul 23, 2025
@jonathanedey jonathanedey changed the title feat(auth): Update ActionCodeSettings to support LinkDomain and deprecate DynamicLinkDomain feat(auth): Update ActionCodeSettings to support LinkDomain and deprecate DynamicLinkDomain Jul 23, 2025
@jonathanedey
Copy link
Contributor

That's everything, thanks again @graeme-verticalscope for putting this together!

@jonathanedey jonathanedey merged commit 056a0c1 into firebase:dev Jul 23, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants