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

Add paranoid flag to options #182

Closed
wants to merge 2 commits into from

Conversation

divagueame
Copy link

Hi, this is my attempt to tackle the paranoid option to hide user existence when requesting token on Sep 21
When the paranoid flag is enabled, and a user tries to sign in with a non existing email:

  • The same behavior will be shown to the user.
  • No email will be sent to non existing emails/user.
  • A session will still be created for non existing emails/user. I am not sure how big of a deal it is, so I left it like that for now.

Copy link
Owner

@mikker mikker left a comment

Choose a reason for hiding this comment

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

Thank you for this. I appreciate how you've done this with the least amount of changes possible. My only concern is the mocked instance var, however I feel it's worth thinking about whether we can do this without it.

def mock_authenticatable
email = passwordless_session_params[email_field].downcase.strip
resource = authenticatable_class.new(email: email)
resource.instance_variable_set(:@mocked, true)
Copy link
Owner

Choose a reason for hiding this comment

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

While this is a clever solution I also think it's a little bit too invasive, I guess. I wonder if we can come up with another solution that completely avoids having to mock anything?

@yenshirak yenshirak mentioned this pull request Jan 19, 2024
@mikker
Copy link
Owner

mikker commented Jan 24, 2024

Thank you for contributing. This feature was implemented in #196 and released in 1.3.0

@mikker mikker closed this Jan 24, 2024
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.

None yet

2 participants