diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-01-06 12:09:57 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-01-06 12:09:57 +0900 |
| commit | fef3d3f300c80bf26b0c6a203db5782f76463151 (patch) | |
| tree | 4b590d2c11e2d1f031cc3fff9ef1c9c76741cdc6 /src/api/streaming.ts | |
| parent | [BREAKING CHANGE] Improve security (diff) | |
| download | misskey-fef3d3f300c80bf26b0c6a203db5782f76463151.tar.gz misskey-fef3d3f300c80bf26b0c6a203db5782f76463151.tar.bz2 misskey-fef3d3f300c80bf26b0c6a203db5782f76463151.zip | |
Refactor: Rename userkey --> access-token
Diffstat (limited to 'src/api/streaming.ts')
| -rw-r--r-- | src/api/streaming.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/api/streaming.ts b/src/api/streaming.ts index dd28a0bc1e..49269ac445 100644 --- a/src/api/streaming.ts +++ b/src/api/streaming.ts @@ -2,7 +2,7 @@ import * as http from 'http'; import * as websocket from 'websocket'; import * as redis from 'redis'; import User from './models/user'; -import Userkey from './models/userkey'; +import AccessToken from './models/access-token'; import isNativeToken from './common/is-native-token'; import homeStream from './stream/home'; @@ -63,18 +63,18 @@ function authenticate(connection: websocket.connection, token: string): Promise< resolve(user); } else { - const userkey = await Userkey.findOne({ + const accessToken = await AccessToken.findOne({ hash: token }); - if (userkey == null) { - return reject('invalid userkey'); + if (accessToken == null) { + return reject('invalid token'); } // Fetch user // SELECT _id const user = await User - .findOne({ _id: userkey.user_id }, { + .findOne({ _id: accessToken.user_id }, { _id: true }); |