verifyPassword Compare whether the password is correct
(_ context.Context, loginPass, userPass string)
| 637 | // verifyPassword |
| 638 | // Compare whether the password is correct |
| 639 | func (us *UserService) verifyPassword(_ context.Context, loginPass, userPass string) bool { |
| 640 | if len(loginPass) == 0 && len(userPass) == 0 { |
| 641 | return true |
| 642 | } |
| 643 | err := bcrypt.CompareHashAndPassword([]byte(userPass), []byte(loginPass)) |
| 644 | return err == nil |
| 645 | } |
| 646 | |
| 647 | // encryptPassword |
| 648 | // The password does irreversible encryption. |
no outgoing calls
no test coverage detected