Expand activity tracking and add PasswordResetAlert job
This commit is contained in:
@@ -638,6 +638,7 @@ class AuthController extends Controller {
|
||||
const token = req.user.mfa_token
|
||||
const codes = await token.generate_recovery()
|
||||
await req.user.save()
|
||||
await this.activity.mfa_recovery_created({ req })
|
||||
return res.api({
|
||||
codes,
|
||||
})
|
||||
@@ -704,6 +705,8 @@ class AuthController extends Controller {
|
||||
req.user.mfa_enable_date = new Date
|
||||
req.user.save()
|
||||
|
||||
await this.activity.mfa_enable({ req })
|
||||
|
||||
// invalidate existing tokens and other logins
|
||||
const flitter = await this.auth.get_provider('flitter')
|
||||
await flitter.logout(req)
|
||||
@@ -724,6 +727,8 @@ class AuthController extends Controller {
|
||||
req.user.app_passwords = []
|
||||
await req.user.save()
|
||||
|
||||
await this.activity.mfa_disable({ req })
|
||||
|
||||
// invalidate existing login tokens and logins
|
||||
const flitter = await this.auth.get_provider('flitter')
|
||||
await flitter.logout(req)
|
||||
|
||||
Reference in New Issue
Block a user