Centralize logout method; delete OIDC sessions on logout
This commit is contained in:
@@ -725,8 +725,7 @@ class AuthController extends Controller {
|
||||
await this.activity.mfa_enable({ req })
|
||||
|
||||
// invalidate existing tokens and other logins
|
||||
const flitter = await this.auth.get_provider('flitter')
|
||||
await flitter.logout(req)
|
||||
await req.user.logout(req)
|
||||
await req.user.kickout()
|
||||
|
||||
return res.api({success: true, mfa_enabled: req.user.mfa_enabled})
|
||||
@@ -747,8 +746,7 @@ class AuthController extends Controller {
|
||||
await this.activity.mfa_disable({ req })
|
||||
|
||||
// invalidate existing login tokens and logins
|
||||
const flitter = await this.auth.get_provider('flitter')
|
||||
await flitter.logout(req)
|
||||
await req.user.logout(req)
|
||||
await req.user.kickout()
|
||||
|
||||
return res.api({success: true, mfa_enabled: req.user.mfa_enabled})
|
||||
|
||||
@@ -91,8 +91,7 @@ class PasswordController extends Controller {
|
||||
if ( req.trap.has_trap() && req.trap.get_trap() === 'password_reset' ) await req.trap.end()
|
||||
|
||||
// invalidate existing tokens and other logins
|
||||
const flitter = await this.auth.get_provider('flitter')
|
||||
await flitter.logout(req)
|
||||
await req.user.logout(req)
|
||||
await req.user.kickout()
|
||||
req.trust.unassume()
|
||||
return res.api()
|
||||
|
||||
@@ -19,7 +19,6 @@ class SAMLController extends Controller {
|
||||
})(req, res, next)
|
||||
}
|
||||
|
||||
// TODO some sort of first-logon flow
|
||||
async get_sso(req, res, next) {
|
||||
const index = await req.saml.participants.issue({ service_provider: req.saml_request.service_provider })
|
||||
|
||||
@@ -71,7 +70,7 @@ class SAMLController extends Controller {
|
||||
this.output.info(`${req.T('saml.clear_idp_session')} ${req.user.uid}`)
|
||||
req.saml.participants.clear().then(async () => {
|
||||
if ( this.saml.config().slo.end_coreid_session ) {
|
||||
await req.user.get_provider().logout(req)
|
||||
await req.user.logout(req)
|
||||
|
||||
// show logout page
|
||||
return this.Vue.auth_message(res, {
|
||||
|
||||
Reference in New Issue
Block a user