diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-03-26 14:51:03 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-26 14:51:03 +0900 |
| commit | 8d7d200efffcf9ffd49dba28f729a6e5b9c11f68 (patch) | |
| tree | 10e3209cd77c3a08b488c08bd4b2f9d7e87de974 /src/api/bot | |
| parent | Merge pull request #1293 from rinsuki/fix/using-hostname-insteadof-host (diff) | |
| parent | Introduce account document to user document (diff) | |
| download | sharkey-8d7d200efffcf9ffd49dba28f729a6e5b9c11f68.tar.gz sharkey-8d7d200efffcf9ffd49dba28f729a6e5b9c11f68.tar.bz2 sharkey-8d7d200efffcf9ffd49dba28f729a6e5b9c11f68.zip | |
Merge pull request #1287 from akihikodaki/account
Introduce account document to user document
Diffstat (limited to 'src/api/bot')
| -rw-r--r-- | src/api/bot/core.ts | 2 | ||||
| -rw-r--r-- | src/api/bot/interfaces/line.ts | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/api/bot/core.ts b/src/api/bot/core.ts index 1f07d4eee9..ad29f1003e 100644 --- a/src/api/bot/core.ts +++ b/src/api/bot/core.ts @@ -225,7 +225,7 @@ class SigninContext extends Context { } } else { // Compare password - const same = await bcrypt.compare(query, this.temporaryUser.password); + const same = await bcrypt.compare(query, this.temporaryUser.account.password); if (same) { this.bot.signin(this.temporaryUser); diff --git a/src/api/bot/interfaces/line.ts b/src/api/bot/interfaces/line.ts index 43c25f8032..bf08821594 100644 --- a/src/api/bot/interfaces/line.ts +++ b/src/api/bot/interfaces/line.ts @@ -110,11 +110,11 @@ class LineBot extends BotCore { data: `showtl|${user.id}` }); - if (user.twitter) { + if (user.account.twitter) { actions.push({ type: 'uri', label: 'Twitterアカウントを見る', - uri: `https://twitter.com/${user.twitter.screen_name}` + uri: `https://twitter.com/${user.account.twitter.screen_name}` }); } @@ -171,7 +171,7 @@ module.exports = async (app: express.Application) => { if (session == null) { const user = await User.findOne({ - line: { + 'account.line': { user_id: sourceId } }); @@ -181,7 +181,7 @@ module.exports = async (app: express.Application) => { bot.on('signin', user => { User.update(user._id, { $set: { - line: { + 'account.line': { user_id: sourceId } } @@ -191,7 +191,7 @@ module.exports = async (app: express.Application) => { bot.on('signout', user => { User.update(user._id, { $set: { - line: { + 'account.line': { user_id: null } } |