Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include request_id in handshake error responses #839

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions server/src/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ class Auth {
return this._jwt.verify(request.token);
case 'unauthenticated':
if (!this._allow_unauthenticated) {
throw new Error('Unauthenticated connections are not allowed.');
return Promise.reject(new Error('Unauthenticated connections are not allowed.'));
}
return this._jwt.verify(this._jwt.sign({ id: null, provider: request.method }).token);
case 'anonymous':
if (!this._allow_anonymous) {
throw new Error('Anonymous connections are not allowed.');
return Promise.reject(new Error('Anonymous connections are not allowed.'));
}
return this.generate(request.method, r.uuid());
default:
throw new Error(`Unknown handshake method "${request.method}"`);
return Promise.reject(new Error(`Unknown handshake method "${request.method}"`));
}
}

Expand Down