quick fixes from previous commit
This commit is contained in:
parent
444f8b00f8
commit
7674907b70
@ -181,7 +181,7 @@ export class Login {
|
|||||||
|
|
||||||
static async purgeTotp (user, password) {
|
static async purgeTotp (user, password) {
|
||||||
user = await User.ensureObject(user, ['password'])
|
user = await User.ensureObject(user, ['password'])
|
||||||
const pwmatch = await User.Login.password(user, password)
|
const pwmatch = await Login.password(user, password)
|
||||||
if (!pwmatch) return false
|
if (!pwmatch) return false
|
||||||
|
|
||||||
// TODO: Inform user via email
|
// TODO: Inform user via email
|
||||||
@ -299,7 +299,7 @@ export class Register {
|
|||||||
const user = await models.User.query().insert(data)
|
const user = await models.User.query().insert(data)
|
||||||
|
|
||||||
if (email) {
|
if (email) {
|
||||||
await User.Register.activationEmail(user, true)
|
await Register.activationEmail(user, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
return user
|
return user
|
||||||
@ -399,7 +399,7 @@ export class Reset {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async changePassword (user, password, token) {
|
static async changePassword (user, password, token) {
|
||||||
const hashed = await User.Register.hashPassword(password)
|
const hashed = await Register.hashPassword(password)
|
||||||
|
|
||||||
await models.User.query().patchAndFetchById(user.id, { password: hashed, updated_at: new Date() })
|
await models.User.query().patchAndFetchById(user.id, { password: hashed, updated_at: new Date() })
|
||||||
await models.Token.query().delete().where('token', token)
|
await models.Token.query().delete().where('token', token)
|
||||||
|
@ -24,12 +24,12 @@ block body
|
|||||||
label(for="password") Password
|
label(for="password") Password
|
||||||
input.form-control(type="password", name="password", id="password")
|
input.form-control(type="password", name="password", id="password")
|
||||||
button.btn.btn-primary(type="submit") Log in
|
button.btn.btn-primary(type="submit") Log in
|
||||||
| or
|
| or
|
||||||
a(href="/register") Create an account
|
a(href="/register") Create an account
|
||||||
| ·
|
| ·
|
||||||
a(href="/login/reset") Forgot password?
|
a(href="/login/reset") Forgot password?
|
||||||
if auth
|
if auth
|
||||||
| ·
|
| ·
|
||||||
a.show-more(href="#",data-toggle="#extlogins") More options..
|
a.show-more(href="#",data-toggle="#extlogins") More options..
|
||||||
.show-more-cnt.mt-4#extlogins
|
.show-more-cnt.mt-4#extlogins
|
||||||
if !registrations
|
if !registrations
|
||||||
|
Reference in New Issue
Block a user