2020-01-26 18:08:06 +01:00
|
|
|
// Copyright 2018-2020 Vikunja and contriubtors. All rights reserved.
|
|
|
|
//
|
|
|
|
// This file is part of Vikunja.
|
|
|
|
//
|
|
|
|
// Vikunja is free software: you can redistribute it and/or modify
|
2020-12-23 16:41:52 +01:00
|
|
|
// it under the terms of the GNU Affero General Public Licensee as published by
|
2020-01-26 18:08:06 +01:00
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Vikunja is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2020-12-23 16:41:52 +01:00
|
|
|
// GNU Affero General Public Licensee for more details.
|
2020-01-26 18:08:06 +01:00
|
|
|
//
|
2020-12-23 16:41:52 +01:00
|
|
|
// You should have received a copy of the GNU Affero General Public Licensee
|
2020-01-26 18:08:06 +01:00
|
|
|
// along with Vikunja. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
package user
|
|
|
|
|
|
|
|
import (
|
2020-10-11 22:10:03 +02:00
|
|
|
"testing"
|
|
|
|
|
2020-01-26 18:08:06 +01:00
|
|
|
"code.vikunja.io/api/pkg/db"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestCreateUser(t *testing.T) {
|
|
|
|
// Our dummy user for testing
|
|
|
|
dummyuser := &User{
|
|
|
|
Username: "testuser",
|
|
|
|
Password: "1234",
|
|
|
|
Email: "noone@example.com",
|
|
|
|
}
|
|
|
|
|
|
|
|
t.Run("normal", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
createdUser, err := CreateUser(s, dummyuser)
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.NotZero(t, createdUser.Created)
|
|
|
|
})
|
|
|
|
t.Run("already existing", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := CreateUser(s, &User{
|
2020-01-26 18:08:06 +01:00
|
|
|
Username: "user1",
|
|
|
|
Password: "12345",
|
|
|
|
Email: "email@example.com",
|
|
|
|
})
|
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrUsernameExists(err))
|
|
|
|
})
|
|
|
|
t.Run("same email", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := CreateUser(s, &User{
|
2020-01-26 18:08:06 +01:00
|
|
|
Username: "testuser",
|
|
|
|
Password: "12345",
|
|
|
|
Email: "user1@example.com",
|
|
|
|
})
|
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrUserEmailExists(err))
|
|
|
|
})
|
|
|
|
t.Run("no username", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := CreateUser(s, &User{
|
2020-01-26 18:08:06 +01:00
|
|
|
Username: "",
|
|
|
|
Password: "12345",
|
|
|
|
Email: "user1@example.com",
|
|
|
|
})
|
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrNoUsernamePassword(err))
|
|
|
|
})
|
|
|
|
t.Run("no password", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := CreateUser(s, &User{
|
2020-01-26 18:08:06 +01:00
|
|
|
Username: "testuser",
|
|
|
|
Password: "",
|
|
|
|
Email: "user1@example.com",
|
|
|
|
})
|
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrNoUsernamePassword(err))
|
|
|
|
})
|
|
|
|
t.Run("no email", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := CreateUser(s, &User{
|
2020-01-26 18:08:06 +01:00
|
|
|
Username: "testuser",
|
|
|
|
Password: "12345",
|
|
|
|
Email: "",
|
|
|
|
})
|
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrNoUsernamePassword(err))
|
|
|
|
})
|
2020-11-21 17:38:58 +01:00
|
|
|
t.Run("same email but different issuer", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := CreateUser(s, &User{
|
2020-11-21 17:38:58 +01:00
|
|
|
Username: "somenewuser",
|
|
|
|
Email: "user1@example.com",
|
|
|
|
Issuer: "https://some.site",
|
|
|
|
Subject: "12345",
|
|
|
|
})
|
|
|
|
assert.NoError(t, err)
|
|
|
|
})
|
|
|
|
t.Run("same subject but different issuer", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := CreateUser(s, &User{
|
2020-11-21 17:38:58 +01:00
|
|
|
Username: "somenewuser",
|
|
|
|
Email: "somenewuser@example.com",
|
|
|
|
Issuer: "https://some.site",
|
|
|
|
Subject: "12345",
|
|
|
|
})
|
|
|
|
assert.NoError(t, err)
|
|
|
|
})
|
2020-01-26 18:08:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestGetUser(t *testing.T) {
|
|
|
|
t.Run("by name", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
theuser, err := getUser(
|
|
|
|
s,
|
|
|
|
&User{
|
|
|
|
Username: "user1",
|
|
|
|
},
|
|
|
|
false,
|
|
|
|
)
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.Equal(t, theuser.ID, int64(1))
|
|
|
|
assert.Empty(t, theuser.Email)
|
|
|
|
})
|
|
|
|
t.Run("by email", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
theuser, err := getUser(
|
|
|
|
s,
|
|
|
|
&User{
|
|
|
|
Email: "user1@example.com",
|
|
|
|
},
|
|
|
|
false)
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.Equal(t, theuser.ID, int64(1))
|
|
|
|
assert.Empty(t, theuser.Email)
|
|
|
|
})
|
|
|
|
t.Run("by id", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
theuser, err := GetUserByID(s, 1)
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.Equal(t, theuser.ID, int64(1))
|
|
|
|
assert.Equal(t, theuser.Username, "user1")
|
|
|
|
assert.Empty(t, theuser.Email)
|
|
|
|
})
|
|
|
|
t.Run("invalid id", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := GetUserByID(s, 99999)
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrUserDoesNotExist(err))
|
|
|
|
})
|
|
|
|
t.Run("nonexistant", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := GetUserByID(s, 0)
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrUserDoesNotExist(err))
|
|
|
|
})
|
|
|
|
t.Run("empty name", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := GetUserByUsername(s, "")
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrUserDoesNotExist(err))
|
|
|
|
})
|
|
|
|
t.Run("with email", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
theuser, err := GetUserWithEmail(s, &User{ID: 1})
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.Equal(t, theuser.ID, int64(1))
|
|
|
|
assert.Equal(t, theuser.Username, "user1")
|
|
|
|
assert.NotEmpty(t, theuser.Email)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestCheckUserCredentials(t *testing.T) {
|
|
|
|
t.Run("normal", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := CheckUserCredentials(s, &Login{Username: "user1", Password: "1234"})
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.NoError(t, err)
|
|
|
|
})
|
|
|
|
t.Run("unverified email", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := CheckUserCredentials(s, &Login{Username: "user5", Password: "1234"})
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrEmailNotConfirmed(err))
|
|
|
|
})
|
|
|
|
t.Run("wrong password", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := CheckUserCredentials(s, &Login{Username: "user1", Password: "12345"})
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrWrongUsernameOrPassword(err))
|
|
|
|
})
|
|
|
|
t.Run("nonexistant user", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := CheckUserCredentials(s, &Login{Username: "dfstestuu", Password: "1234"})
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrWrongUsernameOrPassword(err))
|
|
|
|
})
|
|
|
|
t.Run("empty password", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := CheckUserCredentials(s, &Login{Username: "user1"})
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrNoUsernamePassword(err))
|
|
|
|
})
|
|
|
|
t.Run("empty username", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := CheckUserCredentials(s, &Login{Password: "1234"})
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrNoUsernamePassword(err))
|
|
|
|
})
|
2020-12-18 14:54:49 +01:00
|
|
|
t.Run("email", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := CheckUserCredentials(s, &Login{Username: "user1@example.com", Password: "1234"})
|
2020-12-18 14:54:49 +01:00
|
|
|
assert.NoError(t, err)
|
|
|
|
})
|
2020-01-26 18:08:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestUpdateUser(t *testing.T) {
|
|
|
|
t.Run("normal", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
uuser, err := UpdateUser(s, &User{
|
2020-01-26 18:08:06 +01:00
|
|
|
ID: 1,
|
|
|
|
Password: "LoremIpsum",
|
|
|
|
Email: "testing@example.com",
|
|
|
|
})
|
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.Equal(t, "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.", uuser.Password) // Password should not change
|
|
|
|
assert.Equal(t, "user1", uuser.Username) // Username should not change either
|
|
|
|
})
|
|
|
|
t.Run("change username", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
uuser, err := UpdateUser(s, &User{
|
2020-01-26 18:08:06 +01:00
|
|
|
ID: 1,
|
|
|
|
Username: "changedname",
|
|
|
|
})
|
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.Equal(t, "$2a$14$dcadBoMBL9jQoOcZK8Fju.cy0Ptx2oZECkKLnaa8ekRoTFe1w7To.", uuser.Password) // Password should not change
|
|
|
|
assert.Equal(t, "changedname", uuser.Username)
|
|
|
|
})
|
|
|
|
t.Run("nonexistant", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
_, err := UpdateUser(s, &User{
|
2020-01-26 18:08:06 +01:00
|
|
|
ID: 99999,
|
|
|
|
})
|
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrUserDoesNotExist(err))
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestUpdateUserPassword(t *testing.T) {
|
|
|
|
|
|
|
|
t.Run("normal", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
err := UpdateUserPassword(s, &User{
|
2020-01-26 18:08:06 +01:00
|
|
|
ID: 1,
|
2020-12-23 16:32:28 +01:00
|
|
|
}, "12345")
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.NoError(t, err)
|
|
|
|
})
|
|
|
|
t.Run("nonexistant user", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
err := UpdateUserPassword(s, &User{
|
2020-01-26 18:08:06 +01:00
|
|
|
ID: 9999,
|
|
|
|
}, "12345")
|
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrUserDoesNotExist(err))
|
|
|
|
})
|
|
|
|
t.Run("empty password", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
err := UpdateUserPassword(s, &User{
|
2020-01-26 18:08:06 +01:00
|
|
|
ID: 1,
|
2020-12-23 16:32:28 +01:00
|
|
|
}, "")
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrEmptyNewPassword(err))
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestListUsers(t *testing.T) {
|
|
|
|
t.Run("normal", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
all, err := ListUsers(s, "user1")
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.True(t, len(all) > 0)
|
|
|
|
assert.Equal(t, all[0].Username, "user1")
|
|
|
|
})
|
|
|
|
t.Run("all users", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
|
|
|
all, err := ListUsers(s, "")
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.NoError(t, err)
|
2020-11-21 17:38:58 +01:00
|
|
|
assert.Len(t, all, 14)
|
2020-01-26 18:08:06 +01:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestUserPasswordReset(t *testing.T) {
|
|
|
|
t.Run("normal", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
2020-01-26 18:08:06 +01:00
|
|
|
reset := &PasswordReset{
|
|
|
|
Token: "passwordresettesttoken",
|
|
|
|
NewPassword: "12345",
|
|
|
|
}
|
2020-12-23 16:32:28 +01:00
|
|
|
err := ResetPassword(s, reset)
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.NoError(t, err)
|
|
|
|
})
|
|
|
|
t.Run("without password", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
2020-01-26 18:08:06 +01:00
|
|
|
reset := &PasswordReset{
|
|
|
|
Token: "passwordresettesttoken",
|
|
|
|
}
|
2020-12-23 16:32:28 +01:00
|
|
|
err := ResetPassword(s, reset)
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrNoUsernamePassword(err))
|
|
|
|
})
|
|
|
|
t.Run("empty token", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
2020-01-26 18:08:06 +01:00
|
|
|
reset := &PasswordReset{
|
|
|
|
Token: "somethingsomething",
|
|
|
|
NewPassword: "12345",
|
|
|
|
}
|
2020-12-23 16:32:28 +01:00
|
|
|
err := ResetPassword(s, reset)
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrInvalidPasswordResetToken(err))
|
|
|
|
})
|
|
|
|
t.Run("wrong token", func(t *testing.T) {
|
|
|
|
db.LoadAndAssertFixtures(t)
|
2020-12-23 16:32:28 +01:00
|
|
|
s := db.NewSession()
|
|
|
|
defer s.Close()
|
|
|
|
|
2020-01-26 18:08:06 +01:00
|
|
|
reset := &PasswordReset{
|
|
|
|
Token: "somethingsomething",
|
|
|
|
NewPassword: "12345",
|
|
|
|
}
|
2020-12-23 16:32:28 +01:00
|
|
|
err := ResetPassword(s, reset)
|
2020-01-26 18:08:06 +01:00
|
|
|
assert.Error(t, err)
|
|
|
|
assert.True(t, IsErrInvalidPasswordResetToken(err))
|
|
|
|
})
|
|
|
|
}
|