diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-03-28 09:10:05 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-03-28 09:10:05 +0900 |
| commit | 0cc5ca598a6ca5b3ac105419e905cb89df854698 (patch) | |
| tree | 6f10250d866ac75c2b1bbc18f6c219573bf53ceb /src/api/models/access-token.ts | |
| parent | Merge pull request #1318 from akihikodaki/remote (diff) | |
| download | misskey-0cc5ca598a6ca5b3ac105419e905cb89df854698.tar.gz misskey-0cc5ca598a6ca5b3ac105419e905cb89df854698.tar.bz2 misskey-0cc5ca598a6ca5b3ac105419e905cb89df854698.zip | |
wip
Diffstat (limited to 'src/api/models/access-token.ts')
| -rw-r--r-- | src/api/models/access-token.ts | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/api/models/access-token.ts b/src/api/models/access-token.ts index 9985be5013..9e1cb6474a 100644 --- a/src/api/models/access-token.ts +++ b/src/api/models/access-token.ts @@ -1,8 +1,16 @@ +import * as mongo from 'mongodb'; import db from '../../db/mongodb'; -const collection = db.get('access_tokens'); +const AccessToken = db.get<IAccessTokens>('accessTokens'); +AccessToken.createIndex('token'); +AccessToken.createIndex('hash'); +export default AccessToken; -(collection as any).createIndex('token'); // fuck type definition -(collection as any).createIndex('hash'); // fuck type definition - -export default collection as any; // fuck type definition +export type IAccessTokens = { + _id: mongo.ObjectID; + createdAt: Date; + appId: mongo.ObjectID; + userId: mongo.ObjectID; + token: string; + hash: string; +}; |