aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/oauth-token-interface.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-10 22:15:25 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-10 22:15:25 +0200
commit69818c9394366b954b6ba3bd697bd9d2b09f2a16 (patch)
treead199a18ec3c322460d6f9523fc383ee562554e0 /server/models/oauth-token-interface.ts
parent4d4e5cd4dca78480ec7f40e747f424cd107376a4 (diff)
downloadPeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.gz
PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.zst
PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.zip
Type functions
Diffstat (limited to 'server/models/oauth-token-interface.ts')
-rw-r--r--server/models/oauth-token-interface.ts20
1 files changed, 17 insertions, 3 deletions
diff --git a/server/models/oauth-token-interface.ts b/server/models/oauth-token-interface.ts
index a0cd1ffe7..88526697e 100644
--- a/server/models/oauth-token-interface.ts
+++ b/server/models/oauth-token-interface.ts
@@ -1,11 +1,25 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2import * as Bluebird from 'bluebird'
2 3
3import { UserModel } from './user-interface' 4import { UserModel } from './user-interface'
4 5
6export type OAuthTokenInfo = {
7 refreshToken: string
8 refreshTokenExpiresAt: Date,
9 client: {
10 id: number
11 },
12 user: {
13 id: number
14 }
15}
16
5export namespace OAuthTokenMethods { 17export namespace OAuthTokenMethods {
6 export type GetByRefreshTokenAndPopulateClient = (refreshToken) => void 18 export type GetByRefreshTokenAndPopulateClient = (refreshToken: string) => Bluebird<OAuthTokenInfo>
7 export type GetByTokenAndPopulateUser = (bearerToken) => void 19 export type GetByTokenAndPopulateUser = (bearerToken: string) => Bluebird<OAuthTokenInstance>
8 export type GetByRefreshTokenAndPopulateUser = (refreshToken) => any 20 export type GetByRefreshTokenAndPopulateUser = (refreshToken: string) => Bluebird<OAuthTokenInstance>
21
22 export type RemoveByUserIdCallback = (err: Error) => void
9 export type RemoveByUserId = (userId, callback) => void 23 export type RemoveByUserId = (userId, callback) => void
10} 24}
11 25