2020-05-04 01:16:54 +00:00
|
|
|
const { Controller } = require('libflitter')
|
|
|
|
|
|
|
|
class PasswordController extends Controller {
|
|
|
|
static get services() {
|
|
|
|
return [...super.services, 'Vue']
|
|
|
|
}
|
|
|
|
|
|
|
|
async get_reset(req, res, next) {
|
|
|
|
return res.page('auth:password:reset', {
|
|
|
|
...this.Vue.data(),
|
|
|
|
...this.Vue.session(req),
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2020-05-25 20:45:26 +00:00
|
|
|
async password_reset_keyaction(req, res, next) {
|
|
|
|
req.user.trap = 'password_reset'
|
|
|
|
await req.user.save()
|
|
|
|
req.trust.assume()
|
|
|
|
return res.redirect('/auth/password/reset')
|
|
|
|
}
|
|
|
|
|
2020-05-04 01:16:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = exports = PasswordController
|