summaryrefslogtreecommitdiff
path: root/src/api/streaming.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-01-06 11:07:42 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-01-06 11:07:42 +0900
commit86548f6468217f45d0b59a04e6283492a1eef0bf (patch)
tree64c76889cc1a9aeb9931b79270072def265a23c0 /src/api/streaming.ts
parentMobile: Fix design glitch :art: (diff)
downloadsharkey-86548f6468217f45d0b59a04e6283492a1eef0bf.tar.gz
sharkey-86548f6468217f45d0b59a04e6283492a1eef0bf.tar.bz2
sharkey-86548f6468217f45d0b59a04e6283492a1eef0bf.zip
Refactor: Extract isNativeToken method
Diffstat (limited to 'src/api/streaming.ts')
-rw-r--r--src/api/streaming.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/api/streaming.ts b/src/api/streaming.ts
index 93d5f217b9..84a0f9ddf4 100644
--- a/src/api/streaming.ts
+++ b/src/api/streaming.ts
@@ -3,6 +3,7 @@ import * as websocket from 'websocket';
import * as redis from 'redis';
import User from './models/user';
import Userkey from './models/userkey';
+import isNativeToken from './common/is-native-token';
import homeStream from './stream/home';
import messagingStream from './stream/messaging';
@@ -50,7 +51,7 @@ module.exports = (server: http.Server) => {
function authenticate(connection: websocket.connection, token: string): Promise<any> {
return new Promise(async (resolve, reject) => {
- if (token[0] == '!') {
+ if (isNativeToken(token)) {
// Fetch user
// SELECT _id
const user = await User