feat: use six-digit numeric member invite codes

This commit is contained in:
richjohnrambo
2026-10-15 18:41:35 +08:00
parent b6a0f819b8
commit eb96b7ac1f
7 changed files with 61 additions and 30 deletions
+3
View File
@@ -67,6 +67,9 @@ func (s *Store) RegisterAccount(ctx context.Context, input AccountRegistration)
levelID, parentID, teamLevel, tree, input.InviteCode)
if err != nil {
if isDuplicate(err) {
if strings.Contains(err.Error(), "uk_app_member_invite_code") {
return nil, ErrInviteCodeExists
}
return nil, ErrAccountExists
}
return nil, err
+1
View File
@@ -4,6 +4,7 @@ import "errors"
var (
ErrAccountExists = errors.New("account already exists")
ErrInviteCodeExists = errors.New("invite code already exists")
ErrAccountNotFound = errors.New("account not found")
ErrAccountRestricted = errors.New("account restricted")
ErrAttachmentInvalid = errors.New("attachment invalid")