summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-08 04:44:59 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-08 04:44:59 +0900
commit7f448221ceda4596c5ac0ba2f171f37649d9b156 (patch)
treefb6aab5bf7a665fe61824d367b2fbce6c2a74b18 /src
parentSome bug fixes and clean ups (diff)
downloadmisskey-7f448221ceda4596c5ac0ba2f171f37649d9b156.tar.gz
misskey-7f448221ceda4596c5ac0ba2f171f37649d9b156.tar.bz2
misskey-7f448221ceda4596c5ac0ba2f171f37649d9b156.zip
Fix bugs
Diffstat (limited to 'src')
-rw-r--r--src/client/app/common/mios.ts7
-rw-r--r--src/server/api/private/signin.ts2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/client/app/common/mios.ts b/src/client/app/common/mios.ts
index fd267bc3f8..7baf974adf 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 d7c4832c95..665ee21ebd 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) {