summaryrefslogtreecommitdiff
path: root/src/api/streaming.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-01-06 12:09:57 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-01-06 12:09:57 +0900
commitfef3d3f300c80bf26b0c6a203db5782f76463151 (patch)
tree4b590d2c11e2d1f031cc3fff9ef1c9c76741cdc6 /src/api/streaming.ts
parent[BREAKING CHANGE] Improve security (diff)
downloadmisskey-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.ts10
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
});