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

Added Error message on database user creation if user already exists #443

Merged
merged 9 commits into from Jul 10, 2017
Merged

Added Error message on database user creation if user already exists #443

merged 9 commits into from Jul 10, 2017

Conversation

f2m2rd
Copy link
Contributor

@f2m2rd f2m2rd commented Jul 5, 2017

No description provided.

@@ -153,6 +153,9 @@ struct DatabaseInteractor: DatabaseAuthenticatable, DatabaseUserCreator, Loggabl
case .failure(let cause as AuthenticationError) where cause.code == "invalid_password":
callback(.passwordInvalid, nil)
self.dispatcher.dispatch(result: .error(DatabaseUserCreatorError.passwordInvalid))
case .failure(let cause as AuthenticationError) where cause.code == "user_exists":
Copy link
Member

Choose a reason for hiding this comment

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

Check your indentation please

@@ -30,6 +30,7 @@ enum DatabaseUserCreatorError: Error, LocalizableError {
case passwordHasUserInfo
case passwordInvalid
case passwordAlreadyUsed
case userExists
Copy link
Member

Choose a reason for hiding this comment

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

Indentation

@@ -43,6 +44,8 @@ enum DatabaseUserCreatorError: Error, LocalizableError {
return "PASSWORD HAS PREVIOUSLY BEEN USED.".i18n(key: "com.auth0.lock.error.signup.password_history", comment: "password_history")
case .passwordInvalid:
return "PASSWORD IS INVALID.".i18n(key: "com.auth0.lock.error.signup.invalid_password", comment: "invalid_password")
case .userExists:
Copy link
Member

Choose a reason for hiding this comment

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

Identation

@@ -76,6 +76,8 @@
"com.auth0.lock.error.recoverable.title" = "Can't load the login box";
// Generic sign up error
"com.auth0.lock.error.signup.fallback" = "WE'RE SORRY, SOMETHING WENT WRONG WHEN ATTEMPTING TO SIGN UP.";
// user exists
"com.auth0.lock.error.signup.user_exists" = "THE USER ALREADY EXISTS.";
Copy link
Member

Choose a reason for hiding this comment

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

the way to update this file is by running bundle exec fastlane ios i18n in the Lock directory. It will auto generate the strings file after parsing the source code.

@cocojoe
Copy link
Member

cocojoe commented Jul 5, 2017

@f2m2rd also please add a test 😄

@@ -59,7 +59,11 @@ class DatabaseUserCreatorErrorSpec: QuickSpec {
let error = DatabaseUserCreatorError.nonValidInput
expect(error.localizableMessage).to(contain("SOMETHING WENT WRONG"))
}


it(".userExists should return relevant string") {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks, just update formatting, for reference we use Xcode defaults.

@cocojoe cocojoe changed the title Added Support to Display User Exists Error Message Added Error message on database user creation if user already exists Jul 6, 2017
@cocojoe cocojoe added this to the v2-Next milestone Jul 6, 2017
@cocojoe cocojoe merged commit e3b4a16 into auth0:master Jul 10, 2017
@cocojoe cocojoe modified the milestones: 2.3.1, v2-Next Jul 11, 2017
@cocojoe cocojoe mentioned this pull request Jul 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants