Verify and password reset

* Users can now request a password reset and reset with their token
This commit is contained in:
🐙PiperYxzzy
2022-05-01 19:20:47 +02:00
parent 5903d52755
commit 6c567cd58c
4 changed files with 166 additions and 5 deletions

View File

@@ -21,8 +21,6 @@ func (a *Auth) SetPassword(pass string) error {
return nil
}
const VerifiedRequired = false
func (a *Auth) Login(pass string, tfCode string) (error, bool) {
if err := a.CheckPassword(pass); err != nil {
return err, false
@@ -32,7 +30,7 @@ func (a *Auth) Login(pass string, tfCode string) (error, bool) {
return err, true
}
if !a.Verified && VerifiedRequired {
if !a.Verified {
return errors.New("not yet verified"), true
}