mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
Implement user blocking on server side
This commit is contained in:
parent
6b09aba90d
commit
e69219184b
15 changed files with 287 additions and 59 deletions
|
@ -3,6 +3,7 @@ import { logger } from '../../helpers/logger'
|
|||
import { AccountModel } from '../account/account'
|
||||
import { UserModel } from '../account/user'
|
||||
import { OAuthClientModel } from './oauth-client'
|
||||
import { Transaction } from 'sequelize'
|
||||
|
||||
export type OAuthTokenInfo = {
|
||||
refreshToken: string
|
||||
|
@ -125,7 +126,7 @@ export class OAuthTokenModel extends Model<OAuthTokenModel> {
|
|||
} as OAuthTokenInfo
|
||||
})
|
||||
.catch(err => {
|
||||
logger.info('getRefreshToken error.', { err })
|
||||
logger.error('getRefreshToken error.', { err })
|
||||
throw err
|
||||
})
|
||||
}
|
||||
|
@ -163,11 +164,12 @@ export class OAuthTokenModel extends Model<OAuthTokenModel> {
|
|||
})
|
||||
}
|
||||
|
||||
static deleteUserToken (userId: number) {
|
||||
static deleteUserToken (userId: number, t?: Transaction) {
|
||||
const query = {
|
||||
where: {
|
||||
userId
|
||||
}
|
||||
},
|
||||
transaction: t
|
||||
}
|
||||
|
||||
return OAuthTokenModel.destroy(query)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue