feat: add captcha when signing up (closes #53)
This commit is contained in:
parent
bb3d56f548
commit
6f7eb5eeee
23 changed files with 316 additions and 61 deletions
|
@ -97,6 +97,7 @@ const (
|
|||
ErrAlreadyLinked = 1014 // user already has linked account of the same type
|
||||
ErrNotLinked = 1015 // user already doesn't have a linked account
|
||||
ErrLastProvider = 1016 // unlinking provider would leave account with no authentication method
|
||||
ErrInvalidCaptcha = 1017 // invalid or missing captcha response
|
||||
|
||||
// User-related error codes
|
||||
ErrUserNotFound = 2001
|
||||
|
@ -141,6 +142,7 @@ var errCodeMessages = map[int]string{
|
|||
ErrAlreadyLinked: "Your account is already linked to an account of this type",
|
||||
ErrNotLinked: "Your account is already not linked to an account of this type",
|
||||
ErrLastProvider: "This is your account's only authentication provider",
|
||||
ErrInvalidCaptcha: "Invalid or missing captcha response",
|
||||
|
||||
ErrUserNotFound: "User not found",
|
||||
ErrMemberListPrivate: "This user's member list is private.",
|
||||
|
@ -181,6 +183,7 @@ var errCodeStatuses = map[int]int{
|
|||
ErrAlreadyLinked: http.StatusBadRequest,
|
||||
ErrNotLinked: http.StatusBadRequest,
|
||||
ErrLastProvider: http.StatusBadRequest,
|
||||
ErrInvalidCaptcha: http.StatusBadRequest,
|
||||
|
||||
ErrUserNotFound: http.StatusNotFound,
|
||||
ErrMemberListPrivate: http.StatusForbidden,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue