update/password-reset

This commit is contained in:
SowinskiBraeden committed 2022-01-15 11:57:06 -08:00
1 parent 1b4d2d26db
commit 4513b6389e
3 files changed
+99 -12

No files matched your search

+2 -9
View File
@@ -11,13 +11,6 @@ import (
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Locker struct {
ID primitive.ObjectID `bson:"_id"`
LockerNumber string `json:"lockernumber"`
LockerPasscode string `json:"lockerpasscode"`
LockerType string `json:"lockertype"` // Upper / Lower locker
}
type Student struct {
ID primitive.ObjectID `bson:"_id"`
PersonalData struct {
@@ -66,8 +59,8 @@ func (s *Student) GenerateSchoolEmail() string {
}
func (s *Student) ComparePasswords(password string) bool {
err := bcrypt.CompareHashAndPassword([]byte(s.SchoolData.Password), []byte(password))
if err != nil {
valid := bcrypt.CompareHashAndPassword([]byte(s.SchoolData.Password), []byte(password))
if valid != nil {
return false
}
return true