Fix test and handle errors better
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -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,
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user