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

Only require non-empty value for username when DB connection is custom or import is enabled #646

Merged
merged 3 commits into from
Oct 17, 2016
Merged

Conversation

glena
Copy link
Contributor

@glena glena commented Oct 17, 2016

No description provided.

@glena glena added this to the v10.5.0 milestone Oct 17, 2016
@@ -8,7 +8,8 @@ const DEFAULT_CONNECTION_VALIDATION = { username: { min: 1, max: 15 } };
const regExp = /^[a-zA-Z0-9_]+$/;

function validateUsername(str, validateFormat, settings = DEFAULT_CONNECTION_VALIDATION.username) {
if (!validateFormat) {

if (!validateFormat || !settings) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the connection does not have validation settings, it should only check if the field is empty.
validateFormat overrides this logic to disable validation on login (login should never validate format)

@@ -38,7 +38,7 @@ export default class UsernamePane extends React.Component {
const invalidHint = (str) => {
const hintKey = invalidHintKey(str);

if ("usernameFormatErrorHint" === hintKey && validateFormat) {
if ("usernameFormatErrorHint" === hintKey && validateFormat && usernameValidation) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

only show format info in the error, if there is any format restriction.

username validation on signup + removed validation from login
@hzalaz hzalaz merged commit 0ac5377 into auth0:master Oct 17, 2016
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