Skip to content

Commit

Permalink
Merge pull request #9262 from RocketChat/hotfix/file-access
Browse files Browse the repository at this point in the history
[FIX] File access not working when passing credentials via querystring
  • Loading branch information
rodrigok authored Dec 28, 2017
2 parents 3510fe8 + ff52d6d commit bd83f13
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/rocketchat-file-upload/server/lib/FileUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,14 @@ Object.assign(FileUpload, {
return true;
}

let { uid, token } = query;
let { rc_uid, rc_token } = query;

if (!uid && headers.cookie) {
uid = cookie.get('rc_uid', headers.cookie) ;
token = cookie.get('rc_token', headers.cookie);
if (!rc_uid && headers.cookie) {
rc_uid = cookie.get('rc_uid', headers.cookie) ;
rc_token = cookie.get('rc_token', headers.cookie);
}

if (!uid || !token || !RocketChat.models.Users.findOneByIdAndLoginToken(uid, token)) {
if (!rc_uid || !rc_token || !RocketChat.models.Users.findOneByIdAndLoginToken(rc_uid, rc_token)) {
return false;
}

Expand Down

0 comments on commit bd83f13

Please sign in to comment.