Skip to content
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

fix: Do not intercept manager and scheme links in cozyAppFallbackURL #1032

Merged
merged 1 commit into from
Nov 24, 2023

Conversation

Ldoppea
Copy link
Member

@Ldoppea Ldoppea commented Nov 24, 2023

With current implementation, when clicking on a login email, if the app is already connected to a Cozy, then the app tries to open a cozy-app with that link

We don't want that to happen as it would produce an error and also this is not an expected scenario

To prevent that we want to ignore links that start with a scheme or manager links

Note that this implementation is not bullet proof. Instead of preventing forbidden URLs we should instead hande only authorised ones. This should be done in another commit

Also this bug highlighted another bug: when the login by email scenario ends and when the flagship certification is automatic, then the Linking url event is triggered another time (in useAppBootstrap). So this would trigger the navigation to a cozy-app

By ignoring manager links we removed that bug's side effect but the incorrect behavior (double event) is still present. We must fix that bug in the future

With current implementation, when clicking on a login email, if the app
is already connected to a Cozy, then the app tries to open a cozy-app
with that link

We don't want that to happen as it would produce an error and also this
is not an expected scenario

To prevent that we want to ignore links that start with a scheme or
manager links

Note that this implementation is not bullet proof. Instead of
preventing forbidden URLs we should instead hande only authorised ones.
This should be done in another commit

Also this bug highlighted another bug: when the login by email scenario
ends and when the flagship certification is automatic, then the Linking
`url` event is triggered another time (in useAppBootstrap). So this
would trigger the navigation to a cozy-app

By ignoring manager links we removed that bug's side effect but the
incorrect behavior (double event) is still present. We must fix that
bug in the future
@Ldoppea Ldoppea merged commit dda988b into master Nov 24, 2023
@Ldoppea Ldoppea deleted the fix/login_by_email branch November 24, 2023 10:15
fallback?.startsWith('cozy://') ||
fallback?.startsWith('https://manager.cozycloud.cc') ||
fallback?.startsWith('https://staging-manager.cozycloud.cc') ||
fallback?.startsWith('https://manager-dev.cozycloud.cc')
Copy link
Contributor

Choose a reason for hiding this comment

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

you have strings.cloudery.{prod|int|dev}Uri

Also, you should test the mabulle:// schema, no ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants