Skip to content

Clean whitespace from token#152

Open
tjwalch wants to merge 1 commit intolabd:masterfrom
tjwalch:clean-whitespace-from-token
Open

Clean whitespace from token#152
tjwalch wants to merge 1 commit intolabd:masterfrom
tjwalch:clean-whitespace-from-token

Conversation

@tjwalch
Copy link
Copy Markdown
Contributor

@tjwalch tjwalch commented Nov 19, 2021

Many (all?) authentication apps present the OTP token e g in groups of three ("123 456"). Users should be able to enter the token like it is presented to them, otherwise it is very confusing. Non-skilled users won't understand why they get an error. This PR fixes this by simply removing all whitespace from token before validating.

Comment on lines +22 to +24
'''Remove whitespace because authentication apps often present token
as "123 456". It is very confusing for user if this exact format
isn't supported.'''
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
'''Remove whitespace because authentication apps often present token
as "123 456". It is very confusing for user if this exact format
isn't supported.'''
"""Removes whitespace to support tokens like '123 456' shown in authentication apps."""

{"autofocus": "autofocus", "autocomplete": "off"}
)

def clean_otp_token(self):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please provide a unittest

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.

2 participants