diff options
| author | Akihiko Odaki <nekomanma@pixiv.co.jp> | 2018-03-26 00:19:07 +0900 |
|---|---|---|
| committer | Akihiko Odaki <nekomanma@pixiv.co.jp> | 2018-03-26 14:07:16 +0900 |
| commit | 19b9cb105d49e2a00ae19e3dc1f2d36dc394f148 (patch) | |
| tree | 5faa9ad213bbf2efdcb4d06cf4fc941a501ab7f8 /src/api/endpoints/i/regenerate_token.ts | |
| parent | Allow to use domain whose prefix is not misskey (diff) | |
| download | misskey-19b9cb105d49e2a00ae19e3dc1f2d36dc394f148.tar.gz misskey-19b9cb105d49e2a00ae19e3dc1f2d36dc394f148.tar.bz2 misskey-19b9cb105d49e2a00ae19e3dc1f2d36dc394f148.zip | |
Introduce account document to user document
An account document is attached to a user document if an account of the
user is on the server. It may be missing if the user is on a remote server.
Diffstat (limited to 'src/api/endpoints/i/regenerate_token.ts')
| -rw-r--r-- | src/api/endpoints/i/regenerate_token.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/endpoints/i/regenerate_token.ts b/src/api/endpoints/i/regenerate_token.ts index 653468330f..9ac7b55071 100644 --- a/src/api/endpoints/i/regenerate_token.ts +++ b/src/api/endpoints/i/regenerate_token.ts @@ -20,7 +20,7 @@ module.exports = async (params, user) => new Promise(async (res, rej) => { if (passwordErr) return rej('invalid password param'); // Compare password - const same = await bcrypt.compare(password, user.password); + const same = await bcrypt.compare(password, user.account.password); if (!same) { return rej('incorrect password'); @@ -31,7 +31,7 @@ module.exports = async (params, user) => new Promise(async (res, rej) => { await User.update(user._id, { $set: { - token: secret + 'account.token': secret } }); |