mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-23 19:06:35 +00:00
Merge pull request #196 from trabulium/fix/null-password-handling
fix: Handle NULL password field for imported contacts
This commit is contained in:
@@ -57,7 +57,7 @@ type User struct {
|
||||
PhoneNumber null.String `db:"phone_number" json:"phone_number"`
|
||||
AvatarURL null.String `db:"avatar_url" json:"avatar_url"`
|
||||
Enabled bool `db:"enabled" json:"enabled"`
|
||||
Password string `db:"password" json:"-"`
|
||||
Password null.String `db:"password" json:"-"`
|
||||
LastActiveAt null.Time `db:"last_active_at" json:"last_active_at"`
|
||||
LastLoginAt null.Time `db:"last_login_at" json:"last_login_at"`
|
||||
Roles pq.StringArray `db:"roles" json:"roles"`
|
||||
|
||||
@@ -114,7 +114,7 @@ func (u *Manager) VerifyPassword(email string, password []byte) (models.User, er
|
||||
u.lo.Error("error fetching user from db", "error", err)
|
||||
return user, envelope.NewError(envelope.GeneralError, u.i18n.Ts("globals.messages.errorFetching", "name", "{globals.terms.user}"), nil)
|
||||
}
|
||||
if err := u.verifyPassword(password, user.Password); err != nil {
|
||||
if err := u.verifyPassword(password, user.Password.String); err != nil {
|
||||
return user, envelope.NewError(envelope.InputError, u.i18n.T("user.invalidEmailPassword"), nil)
|
||||
}
|
||||
return user, nil
|
||||
|
||||
Reference in New Issue
Block a user