summaryrefslogtreecommitdiff
path: root/src/api/models/auth-session.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-28 09:10:05 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-28 09:10:05 +0900
commit0cc5ca598a6ca5b3ac105419e905cb89df854698 (patch)
tree6f10250d866ac75c2b1bbc18f6c219573bf53ceb /src/api/models/auth-session.ts
parentMerge pull request #1318 from akihikodaki/remote (diff)
downloadsharkey-0cc5ca598a6ca5b3ac105419e905cb89df854698.tar.gz
sharkey-0cc5ca598a6ca5b3ac105419e905cb89df854698.tar.bz2
sharkey-0cc5ca598a6ca5b3ac105419e905cb89df854698.zip
wip
Diffstat (limited to 'src/api/models/auth-session.ts')
-rw-r--r--src/api/models/auth-session.ts9
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);
});