mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 18:29:27 +02:00
Destroy user token when changing its role
This commit is contained in:
parent
59c48d49c5
commit
f8b8c36b2a
6 changed files with 59 additions and 23 deletions
|
@ -159,4 +159,14 @@ export class OAuthTokenModel extends Model<OAuthTokenModel> {
|
|||
return token
|
||||
})
|
||||
}
|
||||
|
||||
static deleteUserToken (userId: number) {
|
||||
const query = {
|
||||
where: {
|
||||
userId
|
||||
}
|
||||
}
|
||||
|
||||
return OAuthTokenModel.destroy(query)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue