feat(api): declare identity contract for registration, verification, and sessions

This commit is contained in:
shira committed 2026-10-05 22:57:19 +03:00
1 parent 197661145e
commit 653f3775f8
86 files changed
+11826 -148

No files matched your search

@@ -32,16 +32,41 @@ var definitions = map[api.ProblemCode]definition{
title: "Request validation failed",
detail: "One or more request fields are invalid.",
},
api.ProblemCodeVerificationTokenInvalid: {
status: http.StatusBadRequest,
title: "Verification link is not valid",
detail: "Request a new verification link, or sign in if the address is already verified.",
},
api.ProblemCodeVerificationTokenExpired: {
status: http.StatusBadRequest,
title: "Verification link expired",
detail: "Request a new verification link.",
},
api.ProblemCodeUnauthenticated: {
status: http.StatusUnauthorized,
title: "Authentication required",
detail: "Sign in and repeat the request.",
},
api.ProblemCodeInvalidCredentials: {
status: http.StatusUnauthorized,
title: "Invalid email or password",
detail: "Check the email and password and try again.",
},
api.ProblemCodeForbidden: {
status: http.StatusForbidden,
title: "Access denied",
detail: "You do not have permission to perform this operation.",
},
api.ProblemCodeEmailNotVerified: {
status: http.StatusForbidden,
title: "Email not verified",
detail: "Confirm the email address with the link from the verification message.",
},
api.ProblemCodeCsrfCheckFailed: {
status: http.StatusForbidden,
title: "Cross-site request check failed",
detail: "Read the current session to get a new CSRF token and repeat the request.",
},
api.ProblemCodeNotFound: {
status: http.StatusNotFound,
title: "Resource not found",