Skip to content

Support case-insensitive tokens? #248

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

Open
StevenClontz opened this issue Feb 24, 2025 · 5 comments · May be fixed by #249
Open

Support case-insensitive tokens? #248

StevenClontz opened this issue Feb 24, 2025 · 5 comments · May be fixed by #249

Comments

@StevenClontz
Copy link
Contributor

My token generator uses only uppercase letters and numbers. When hand-entering the token, sometimes the user is lazy and writes letters in lowercase, which I want to allow. I'm supporting this by re-implementing Passwordless::Session, but it'd be nice if this was a configuration option.

@mikker
Copy link
Owner

mikker commented Feb 24, 2025

I think this could be an okay addition behind a config flag. Default is current implementation, so something like config.case_insensitive_tokens = true.

PRs welcome.

@StevenClontz
Copy link
Contributor Author

WIP at #249

@bluefantail
Copy link

bluefantail commented Mar 2, 2025

I've just spent some time debugging after a few user reports of code entry trouble, turns out it was this and people were naturally just 'expecting' case insensitivity! Very keen on this PR, might even be worth calling it out somewhere clearly in the readme as I feel like it's possibly a common tripwire for people?

(Edit: On closer inspection the detail included in the PR there is probably enough)

@StevenClontz
Copy link
Contributor Author

I'm very fortunate to have an early adopter of my app who correctly pivoted to matching case. My stop gap fix is just including my own copy of session.rb (basically the PR version) in the app for now. Would be happy to return to vanilla in a future version if this is merged.

@bluefantail
Copy link

Nice yeah, I've just been testing a modified version without the config since I only want the upcase version as the default anyway — seems good so far.

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

Successfully merging a pull request may close this issue.

3 participants