summaryrefslogtreecommitdiff
path: root/db/account.go
diff options
context:
space:
mode:
Diffstat (limited to 'db/account.go')
-rw-r--r--db/account.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/db/account.go b/db/account.go
index b7bcaa0..c7f76bf 100644
--- a/db/account.go
+++ b/db/account.go
@@ -4,7 +4,7 @@ import "errors"
type Account struct {
UserName string
- PassHash string
+ PassHash string `json:",omitempty"`
Info *Login
}
@@ -69,9 +69,10 @@ func (ac *Account) Login(safe *SafeDB) error {
if err != nil {
return err
}
- if PassHash != ac.PassHash {
+ if PassHash != ToBlake3(ac.PassHash) {
return errors.New("Auth failed")
}
+ ac.PassHash = ""
err = ac.Info.Bearer.Generate(safe, ac.Info)
if err != nil {