From 96c7153188a7bbdb6d40e8a4fe45a4cd4e5c4884 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 8 Apr 2018 04:44:59 +0900 Subject: [PATCH] Fix bugs --- package.json | 2 +- src/client/app/common/mios.ts | 7 ++++++- src/server/api/private/signin.ts | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 78b812e96..08119fe32 100644 --- a/package.json +++ b/package.json @@ -203,7 +203,7 @@ "vue-cropperjs": "2.2.0", "vue-js-modal": "1.3.12", "vue-json-tree-view": "2.1.3", - "vue-loader": "15.0.0-rc.1", + "vue-loader": "14.2.2", "vue-router": "3.0.1", "vue-template-compiler": "2.5.16", "vuedraggable": "2.16.0", diff --git a/src/client/app/common/mios.ts b/src/client/app/common/mios.ts index fd267bc3f..7baf974ad 100644 --- a/src/client/app/common/mios.ts +++ b/src/client/app/common/mios.ts @@ -220,7 +220,7 @@ export default class MiOS extends EventEmitter { public signout() { localStorage.removeItem('me'); - document.cookie = `i=; domain=.${hostname}; expires=Thu, 01 Jan 1970 00:00:01 GMT;`; + document.cookie = `i=; domain=${hostname}; expires=Thu, 01 Jan 1970 00:00:01 GMT;`; location.href = '/'; } @@ -325,6 +325,11 @@ export default class MiOS extends EventEmitter { // キャッシュがあったとき if (cachedMe) { + if (cachedMe.token == null) { + this.signout(); + return; + } + // とりあえずキャッシュされたデータでお茶を濁して(?)おいて、 fetched(cachedMe); diff --git a/src/server/api/private/signin.ts b/src/server/api/private/signin.ts index d7c4832c9..665ee21eb 100644 --- a/src/server/api/private/signin.ts +++ b/src/server/api/private/signin.ts @@ -49,7 +49,7 @@ export default async (req: express.Request, res: express.Response) => { } // Compare password - const same = await bcrypt.compare(password, password); + const same = await bcrypt.compare(password, user.password); if (same) { if (user.twoFactorEnabled) {