Fix test and handle errors better

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-10-13 17:03:48 +02:00
parent 3e4bd76f29
commit 14369e61e9
8 changed files with 42 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ export const defaultError: IError = {
value: i18n.t('An error has occurred.') as string,
};
export interface IError { match: RegExp; value: string; suggestRefresh?: boolean; }
export interface IError { match: RegExp; value: string|null; suggestRefresh?: boolean; }
export const errors: IError[] = [
{
@@ -48,4 +48,28 @@ export const errors: IError[] = [
value: i18n.t("The current identity doesn't have any permission on this event. You should probably change it.") as string,
suggestRefresh: false,
},
{
match: /^User with email not found$/,
value: null,
},
{
match: /^Username is already taken$/,
value: null,
},
{
match: /^No user with this email was found$/,
value: null,
},
{
match: /^Impossible to authenticate, either your email or password are invalid.$/,
value: null,
},
{
match: /^No user to validate with this email was found$/,
value: null,
},
{
match: /^This email is already used.$/,
value: null,
},
];