use authorize flag instead of unlock

This commit is contained in:
Carlosokumu 2024-08-29 23:22:27 +03:00
parent 54d777de04
commit dd0b0ce5a3
Signed by: carlos
GPG Key ID: 7BD6BC8160A5C953

View File

@ -59,14 +59,7 @@ func NewHandlers(path string, st *state.State) *Handlers {
}
}
// Define the regex pattern as a constant
const pinPattern = `^\d{4}$`
// isValidPIN checks whether the given input is a 4 digit number
func isValidPIN(pin string) bool {
match, _ := regexp.MatchString(pinPattern, pin)
return match
}
// Define the regex pattern as a constant
const pinPattern = `^\d{4}$`
@ -467,7 +460,7 @@ func (h *Handlers) Quit(ctx context.Context, sym string, input []byte) (resource
l.AddDomain("default")
res.Content = l.Get("Thank you for using Sarafu. Goodbye!")
res.FlagReset = append(res.FlagReset, models.USERFLAG_ACCOUNT_UNLOCKED)
res.FlagReset = append(res.FlagReset, models.USERFLAG_ACCOUNT_AUTHORIZED)
return res, nil
}