summaryrefslogtreecommitdiff
path: root/src/api/service
diff options
context:
space:
mode:
authorAkihiko Odaki <nekomanma@pixiv.co.jp>2018-03-26 00:19:07 +0900
committerAkihiko Odaki <nekomanma@pixiv.co.jp>2018-03-26 14:07:16 +0900
commit19b9cb105d49e2a00ae19e3dc1f2d36dc394f148 (patch)
tree5faa9ad213bbf2efdcb4d06cf4fc941a501ab7f8 /src/api/service
parentAllow to use domain whose prefix is not misskey (diff)
downloadmisskey-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/service')
-rw-r--r--src/api/service/twitter.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/api/service/twitter.ts b/src/api/service/twitter.ts
index adcd5ac49b..02b613454c 100644
--- a/src/api/service/twitter.ts
+++ b/src/api/service/twitter.ts
@@ -39,10 +39,10 @@ module.exports = (app: express.Application) => {
if (userToken == null) return res.send('plz signin');
const user = await User.findOneAndUpdate({
- token: userToken
+ 'account.token': userToken
}, {
$set: {
- twitter: null
+ 'account.twitter': null
}
});
@@ -126,7 +126,7 @@ module.exports = (app: express.Application) => {
const result = await twAuth.done(JSON.parse(ctx), req.query.oauth_verifier);
const user = await User.findOne({
- 'twitter.user_id': result.userId
+ 'account.twitter.user_id': result.userId
});
if (user == null) {
@@ -148,10 +148,10 @@ module.exports = (app: express.Application) => {
const result = await twAuth.done(JSON.parse(ctx), verifier);
const user = await User.findOneAndUpdate({
- token: userToken
+ 'account.token': userToken
}, {
$set: {
- twitter: {
+ 'account.twitter': {
access_token: result.accessToken,
access_token_secret: result.accessTokenSecret,
user_id: result.userId,