update CheckPassword
This commit is contained in:
parent
a1e5a1092b
commit
b3d38cabb9
1 changed files with 3 additions and 7 deletions
|
@ -43,17 +43,13 @@ func (storage BlockchainStorage) Delete(id string) (err error) {
|
|||
|
||||
func (storage BlockchainStorage) CheckPassword(id string, secret util.Uint256) (bool, error) {
|
||||
_, err := storage.contract.CheckUser(id, secret)
|
||||
if err == nil {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
if err.Error() == "Password hashes does not match" {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func main() {
|
||||
manager := manage.NewDefaultManager()
|
||||
manager.SetAuthorizeCodeTokenCfg(manage.DefaultAuthorizeCodeTokenCfg)
|
||||
|
|
Loading…
Reference in a new issue