Closed
Description
Feature request
Is your feature request related to a problem? Please describe.
It is currently impossible to differentiate errors, e.g: when a user signs up there is a multitude of possible errors (network errors, database errors, etc) and although you can easily check if an error occured (if (res.error !== null) { /**/ }
) it is not possible to know which error happened.
Describe the solution you'd like
Enum error types:
enum SignUpError {
InvalidEmail,
SignUpsDisabled,
NetworkError,
/* etc */
}
enum SignInError {
InvalidCredentials,
/* etc */
}
export default class GoTrueClient {
// --snip--
signUp(credentials: {
email: string;
password: string;
}): Promise<{ /* success object */ } | SignUpError>;
signIn(credentials: {
email?: string;
password?: string;
provider?: Provider;
}): Promise<{ /* success object */ } | SignInError>;
// --snip--
}
Describe alternatives you've considered
I am not aware of any alternative.