diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/enums/CreateAccountResult.java b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/CreateAccountResult.java index f44a159..9af17cc 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/enums/CreateAccountResult.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/enums/CreateAccountResult.java @@ -12,6 +12,11 @@ public enum CreateAccountResult { */ SUCCESS, + /** + * Too many account creation requests + */ + ERROR_TOO_MANY_REQUESTS, + /** * Trying to login with an existing email address */ diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/AccountHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/AccountHelper.java index 9accce1..ef63750 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/AccountHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/AccountHelper.java @@ -209,6 +209,9 @@ public class AccountHelper { case 409: return CreateAccountResult.ERROR_EXISTING_EMAIL; + case 429: + return CreateAccountResult.ERROR_TOO_MANY_REQUESTS; + default: return CreateAccountResult.ERROR; diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/CreateAccountActivity.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/CreateAccountActivity.java index 7f51cec..b980efb 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/CreateAccountActivity.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/ui/activities/CreateAccountActivity.java @@ -250,6 +250,11 @@ public class CreateAccountActivity extends AppCompatActivity int message = R.string.err_while_creating_account; switch (result){ + //Too many account creation requests + case ERROR_TOO_MANY_REQUESTS: + message = R.string.err_create_account_too_many_requests; + break; + //Existing email address case ERROR_EXISTING_EMAIL: message = R.string.err_create_account_existing_email; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d3b281e..b135c44 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -234,4 +234,5 @@ Sign in Too many failed login requests. Please try again later… This email address is already associated with an account! + Too many account creation requests. Please try again later...