refactor: user curd

This commit is contained in:
Jacky 2025-01-31 23:11:14 +08:00
parent 80f01e61d3
commit 465eae9858
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
19 changed files with 1601 additions and 1881 deletions

View file

@ -3,13 +3,15 @@ package user
import "github.com/uozi-tech/cosy"
var (
e = cosy.NewErrorScope("user")
ErrPasswordIncorrect = e.New(40301, "password incorrect")
ErrUserBanned = e.New(40303, "user banned")
ErrOTPCode = e.New(40304, "invalid otp code")
ErrRecoveryCode = e.New(40305, "invalid recovery code")
ErrWebAuthnNotConfigured = e.New(50000, "WebAuthn settings are not configured")
ErrUserNotEnabledOTPAs2FA = e.New(50001, "user not enabled otp as 2fa")
ErrOTPOrRecoveryCodeEmpty = e.New(50002, "otp or recovery code empty")
ErrSessionNotFound = e.New(40401, "session not found")
e = cosy.NewErrorScope("user")
ErrPasswordIncorrect = e.New(40301, "password incorrect")
ErrUserBanned = e.New(40303, "user banned")
ErrOTPCode = e.New(40304, "invalid otp code")
ErrRecoveryCode = e.New(40305, "invalid recovery code")
ErrWebAuthnNotConfigured = e.New(50000, "WebAuthn settings are not configured")
ErrUserNotEnabledOTPAs2FA = e.New(50001, "user not enabled otp as 2fa")
ErrOTPOrRecoveryCodeEmpty = e.New(50002, "otp or recovery code empty")
ErrCannotRemoveInitUser = e.New(50003, "cannot remove initial user")
ErrChangeInitUserPwdInDemo = e.New(50004, "cannot change initial user password in demo mode")
ErrSessionNotFound = e.New(40401, "session not found")
)