1
0
Fork 0
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:
Chocobozzz 2018-01-23 09:15:36 +01:00
parent 59c48d49c5
commit f8b8c36b2a
No known key found for this signature in database
GPG key ID: 583A612D890159BE
6 changed files with 59 additions and 23 deletions

View file

@ -159,4 +159,14 @@ export class OAuthTokenModel extends Model<OAuthTokenModel> {
return token
})
}
static deleteUserToken (userId: number) {
const query = {
where: {
userId
}
}
return OAuthTokenModel.destroy(query)
}
}