[API] Fix bug

This commit is contained in:
syuilo 2017-01-21 07:45:49 +09:00
parent 43e6ddc1e4
commit 225c89a5b8

View File

@ -51,6 +51,10 @@ module.exports = (server: http.Server) => {
}; };
function authenticate(connection: websocket.connection, token: string): Promise<any> { function authenticate(connection: websocket.connection, token: string): Promise<any> {
if (token == null) {
return Promise.resolve(null);
}
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
if (isNativeToken(token)) { if (isNativeToken(token)) {
// Fetch user // Fetch user