Errors reference
goauth returns JSON errors with a kind field (Auth.js-style).
Common kinds
| Kind | When |
|---|---|
Configuration | Invalid setup, unknown provider |
AccessDenied | SignIn callback returned false |
Verification | Bad token, passkey verify failed, OTP wrong |
CredentialsSignin | Authorize failed |
MFARequired | MFA challenge issued (informational) |
MFAVerification | MFA step failed |
AdapterError | Database adapter failure |
UnknownAction | Invalid route |
Example response
{
"message": "verify assertion",
"kind": "Verification"
}
Handling in clients
const res = await fetch("/auth/callback/passkey", { method: "POST", body });
if (!res.ok) {
const err = await res.json();
if (err.kind === "Verification") {
// show passkey retry UI
}
}
Use errors.Is with sentinel errors (ErrMissingAdapter, etc.) in Go middleware wrapping the handler.