Mark the user as deactivated in the user deactivation job
This commit is contained in:
@@ -42,7 +42,7 @@ impl RunnableJob for DeactivateUserJob {
|
||||
.context("User not found")
|
||||
.map_err(JobError::fail)?;
|
||||
|
||||
// Let's first lock the user
|
||||
// Let's first lock & deactivate the user
|
||||
let user = repo
|
||||
.user()
|
||||
.lock(&clock, user)
|
||||
@@ -50,6 +50,13 @@ impl RunnableJob for DeactivateUserJob {
|
||||
.context("Failed to lock user")
|
||||
.map_err(JobError::retry)?;
|
||||
|
||||
let user = repo
|
||||
.user()
|
||||
.deactivate(&clock, user)
|
||||
.await
|
||||
.context("Failed to deactivate user")
|
||||
.map_err(JobError::retry)?;
|
||||
|
||||
// Kill all sessions for the user
|
||||
let n = repo
|
||||
.browser_session()
|
||||
|
||||
Reference in New Issue
Block a user