[FIX] Cloud Register Allowing Empty Tokens (#19501)

pull/19498/head
Bradley Hilton 5 years ago committed by GitHub
parent 5f71b0abe3
commit 91b0e4e42d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      app/cloud/server/functions/connectWorkspace.js
  2. 4
      app/cloud/server/methods.js

@ -13,6 +13,12 @@ export function connectWorkspace(token) {
Settings.updateValueById('Register_Server', true);
}
// shouldn't get here due to checking this on the method
// but this is just to double check
if (!token) {
return new Error('Invalid token; the registration token is required.');
}
const redirectUri = getRedirectUri();
const regInfo = {

@ -70,6 +70,10 @@ Meteor.methods({
throw new Meteor.Error('error-not-authorized', 'Not authorized', { method: 'cloud:connectServer' });
}
if (!token) {
throw new Meteor.Error('error-invalid-payload', 'Token is required.', { method: 'cloud:connectServer' });
}
return connectWorkspace(token);
},
'cloud:disconnectWorkspace'() {

Loading…
Cancel
Save