while migrating a backend to supabase i noticed GotrueException.Reason is guessed from the message text. FailureHint.DetectReason does Content.Contains("Invalid login"), Contains("email"), Contains("password") and so on, ordered by status code.
the auth server has returned a machine readable error_code in every error body since early 2024 (invalid_credentials, email_not_confirmed, refresh_token_not_found, user_already_exists, weak_password, ...). every other official client (js, swift, kotlin, python, flutter) reads that field and exposes it as a typed code.
while migrating a backend to supabase i noticed GotrueException.Reason is guessed from the message text. FailureHint.DetectReason does Content.Contains("Invalid login"), Contains("email"), Contains("password") and so on, ordered by status code.
the auth server has returned a machine readable error_code in every error body since early 2024 (invalid_credentials, email_not_confirmed, refresh_token_not_found, user_already_exists, weak_password, ...). every other official client (js, swift, kotlin, python, flutter) reads that field and exposes it as a typed code.