-
Notifications
You must be signed in to change notification settings - Fork 104
TF-4145 Changing the way to get the URL
#4147
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
base: master
Are you sure you want to change the base?
TF-4145 Changing the way to get the URL
#4147
Conversation
|
This PR has been deployed to https://linagora.github.io/tmail-flutter/4147. |
| /// Generates a web link based on a workplace FQDN and app slug. | ||
| /// | ||
| /// Throws [ArgumentError] when input is invalid. | ||
| static String generateWebLink({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for paywall, it should not the same pattern: https://tdvudev.stg.lin-saas.com/settings/premium, so IMO, we should have a different way to generate paywall link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not according to the ADR description of this issue we need to generate paywall from workplaceFqdn. The generateWebLink function is the function used to handle workplaceFqdn, so we still need it. And if we handle it according to this function our current paywall will be https://tdvudev.stg.lin-saas.com/premium instead of https://tdvudev.stg.lin-saas.com/settings/premium. And we also have a fallback for if this generateWebLink process fails. We will get the paywall link generated from eco-system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated paywall url correctly from workplaceFqdn
Issue
#4145
Summary
Refactor the logic to generate the
PaywallURL using the user'sworkplaceFqdninstead of relying solely on static domain resolution.Context
Previously, the Paywall URL was built using a default fallback pattern (
pattern.getQualifiedUrl), which combined the user's email and a root domain fromRouteUtils.getRootDomain(). This approach worked, but did not respect the user’s actual workspace domain (FQDN).To fix this, the system now leverages the
workplaceFqdnobtained from the authenticated OIDC user info (oidcUserInfo.workplaceFqdn) to dynamically generate thePaywallURL for the correct tenant.Implementation Details
WebLinkGenerator.safeGenerateWebLinkworkplaceFqdnvalue (e.g. alice.example.app) is passed toWebLinkGeneratorto construct the Paywall URL.https://link.If
workplaceFqdnis unavailable or invalid, the code now gracefully falls back to:This ensures that even in the worst case, the Paywall link remains functional.