From fb387fe290d907dd8a1b0e3600c5468043071628 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Sat, 16 Mar 2024 10:35:18 +0530 Subject: api/login: init --- db/account.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'db/account.go') 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 { -- cgit v1.2.3