mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
expliciting type checks and predicates (server only)
This commit is contained in:
parent
5f7021c33d
commit
c1e791bad0
34 changed files with 127 additions and 84 deletions
|
@ -154,9 +154,12 @@ export class OAuthTokenModel extends Model<OAuthTokenModel> {
|
|||
return OAuthTokenModel.scope(ScopeNames.WITH_ACCOUNT)
|
||||
.findOne(query)
|
||||
.then(token => {
|
||||
token['user'] = token.User
|
||||
|
||||
return token
|
||||
if (token) {
|
||||
token['user'] = token.User
|
||||
return token
|
||||
} else {
|
||||
return new OAuthTokenModel()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue