mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-11-20 08:08:58 +00:00
fix: revoke api tokens and mcp oauth grants on leave_instance (#12430)
* fix: revoke api tokens and mcp oauth grants on leave_instance Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test: pin token deletion on leave_instance Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
495e4435db
commit
2c39bf044a
@@ -1315,6 +1315,10 @@ async fn join_workspace<'c>(
|
||||
async fn leave_instance(Extension(db): Extension<DB>, authed: ApiAuthed) -> Result<String> {
|
||||
forbid_job_token_account_destruction(&authed)?;
|
||||
let mut tx = db.begin().await?;
|
||||
revoke_mcp_oauth_grants(&mut *tx, &authed.email, None).await?;
|
||||
sqlx::query!("DELETE FROM token WHERE email = $1", &authed.email)
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
sqlx::query!("DELETE FROM password WHERE email = $1", &authed.email)
|
||||
.execute(&mut *tx)
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user