-
Notifications
You must be signed in to change notification settings - Fork 110
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
Conversation
Lock/DatabaseInteractor.swift
Outdated
@@ -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": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check your indentation please
Lock/DatabaseUserCreatorError.swift
Outdated
@@ -30,6 +30,7 @@ enum DatabaseUserCreatorError: Error, LocalizableError { | |||
case passwordHasUserInfo | |||
case passwordInvalid | |||
case passwordAlreadyUsed | |||
case userExists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation
Lock/DatabaseUserCreatorError.swift
Outdated
@@ -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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identation
Lock/Base.lproj/Lock.strings
Outdated
@@ -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."; |
There was a problem hiding this comment.
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.
@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") { |
There was a problem hiding this comment.
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.
- Indention
No description provided.