trashposs/src/server/api/models/access-token.ts
2018-03-29 14:48:47 +09:00

17 lines
381 B
TypeScript

import * as mongo from 'mongodb';
import db from '../../../db/mongodb';
const AccessToken = db.get<IAccessTokens>('accessTokens');
AccessToken.createIndex('token');
AccessToken.createIndex('hash');
export default AccessToken;
export type IAccessTokens = {
_id: mongo.ObjectID;
createdAt: Date;
appId: mongo.ObjectID;
userId: mongo.ObjectID;
token: string;
hash: string;
};