Add an API to reset the password

This commit is contained in:
Nikolai Rodionov 2024-05-22 11:38:53 +02:00
parent b0ce3f1248
commit b533372b22
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD

View File

@ -49,6 +49,11 @@ func (svc *EmailSvc) SendVerification(ctx context.Context) error {
}, accountData); err != nil {
return err
}
if val, ok := userns.Labels["email-verified"]; ok && val == "true" {
return errors.Error("email is already verified")
}
number := encodeToString(6)
svc.Data.Code = number
if !svc.DevMode {