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

UI preview mode: disable log in and log out #4804

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

ajpallares
Copy link
Member

@ajpallares ajpallares commented Feb 20, 2025

Checklist

  • If applicable, unit tests

Motivation

Even though no calls to logIn or logOut should happen in UI preview mode, it's still appropriate to make sure that the SDK properly controls that scenario.

Description

  • With this PR, the SDK implements early returns in the IdentityManager for the logIn and logOut methods, preventing any logic in this scenario (including any log in request to the backend)
  • Calling logIn using the app user ID reserved for UI preview mode also fails, even if UI preview mode is not enabled

@ajpallares ajpallares requested a review from a team February 20, 2025 12:20
@ajpallares ajpallares marked this pull request as ready for review February 20, 2025 12:20
Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

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

Makes sense! I guess we have a lot of APIs we might want to disable... But this is a good start!

@ajpallares
Copy link
Member Author

Makes sense! I guess we have a lot of APIs we might want to disable... But this is a good start!

Exactly! I'm going one by one making sure that they are disabled in UI preview mode (even if they are not meant to be used while in UI preview mode). But #BetterSafeThanSorry 😄

@ajpallares ajpallares merged commit 6c07039 into main Feb 20, 2025
10 checks passed
@ajpallares ajpallares deleted the uiPreviewMode/log-in-or-out-unsupported branch February 20, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants