From 9427a756c9e4a1d95210ccfca56fdb67d62183ec Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 16 Oct 2018 11:38:09 +0900 Subject: Update mongodb --- src/models/auth-session.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/models/auth-session.ts') diff --git a/src/models/auth-session.ts b/src/models/auth-session.ts index 3d2c9ee3c1..3458d5675f 100644 --- a/src/models/auth-session.ts +++ b/src/models/auth-session.ts @@ -1,6 +1,7 @@ import * as mongo from 'mongodb'; const deepcopy = require('deepcopy'); import db from '../db/mongodb'; +import isObjectId from '../misc/is-objectid'; import { pack as packApp } from './app'; const AuthSession = db.get('authSessions'); @@ -31,7 +32,7 @@ export const pack = ( _session = deepcopy(session); // Me - if (me && !mongo.ObjectID.prototype.isPrototypeOf(me)) { + if (me && !isObjectId(me)) { if (typeof me === 'string') { me = new mongo.ObjectID(me); } else { -- cgit v1.2.3-freya