aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/oauth-token-interface.ts
diff options
context:
space:
mode:
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