diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-03-28 17:05:36 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-28 17:05:36 +0900 |
| commit | 46e530ef41bb640cfa66438e888d1ecd6f90f6bb (patch) | |
| tree | a23eefae5e437ad6adc7dfe190daba81138aa70b /src/api/models/auth-session.ts | |
| parent | #1294 (diff) | |
| parent | oops (diff) | |
| download | sharkey-46e530ef41bb640cfa66438e888d1ecd6f90f6bb.tar.gz sharkey-46e530ef41bb640cfa66438e888d1ecd6f90f6bb.tar.bz2 sharkey-46e530ef41bb640cfa66438e888d1ecd6f90f6bb.zip | |
Merge pull request #1324 from syuilo/#1288-2
snake_case を camelCase にするなどした
Diffstat (limited to 'src/api/models/auth-session.ts')
| -rw-r--r-- | src/api/models/auth-session.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/api/models/auth-session.ts b/src/api/models/auth-session.ts index 997ec61c20..e6b8b2318e 100644 --- a/src/api/models/auth-session.ts +++ b/src/api/models/auth-session.ts @@ -3,11 +3,15 @@ import deepcopy = require('deepcopy'); import db from '../../db/mongodb'; import { pack as packApp } from './app'; -const AuthSession = db.get('auth_sessions'); +const AuthSession = db.get<IAuthSession>('authSessions'); export default AuthSession; export interface IAuthSession { _id: mongo.ObjectID; + createdAt: Date; + appId: mongo.ObjectID; + userId: mongo.ObjectID; + token: string; } /** @@ -24,7 +28,6 @@ export const pack = ( let _session: any; // TODO: Populate session if it ID - _session = deepcopy(session); // Me @@ -39,7 +42,7 @@ export const pack = ( delete _session._id; // Populate app - _session.app = await packApp(_session.app_id, me); + _session.app = await packApp(_session.appId, me); resolve(_session); }); |