Make registration carry flow all the way through
This commit is contained in:
@@ -90,6 +90,10 @@ class PasswordController extends Controller {
|
||||
await this.activity.password_reset({ req, ip: req.ip })
|
||||
if ( req.trap.has_trap() && req.trap.get_trap() === 'password_reset' ) await req.trap.end()
|
||||
|
||||
if ( req.session.registrant_flow ) {
|
||||
await req.trap.begin('registrant_flow', { session_only: true })
|
||||
}
|
||||
|
||||
// invalidate existing tokens and other logins
|
||||
await req.user.logout(req)
|
||||
await req.user.kickout()
|
||||
|
||||
@@ -11,11 +11,21 @@ class Forms extends FormController {
|
||||
}
|
||||
|
||||
async registration_provider_get(req, res, next) {
|
||||
if ( req.session.auth.flow ) {
|
||||
req.session.registrant_flow = req.session.auth.flow
|
||||
}
|
||||
|
||||
return res.page('auth:register', {
|
||||
...this.Vue.data({})
|
||||
})
|
||||
}
|
||||
|
||||
async finish_registration(req, res, next) {
|
||||
if ( req.trap.has_trap() && req.trap.get_trap() === 'registrant_flow' ) await req.trap.end()
|
||||
const dest = req.session.registrant_flow || '/dash/profile'
|
||||
return res.redirect(dest)
|
||||
}
|
||||
|
||||
async login_provider_get(req, res, next) {
|
||||
const Setting = this.models.get('Setting')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user