Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Wrong secure token on download.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Jun 1, 2017
1 parent 21d3edc commit db7854e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions core/src/plugins/gui.ajax/res/js/core/http/PydioApi.es6
Expand Up @@ -24,17 +24,11 @@ import XMLUtils from '../util/XMLUtils'
class PydioApi{

constructor(){
this._secureToken = '';
}

setPydioObject(pydioObject){
this._pydioObject = pydioObject;
this._baseUrl = pydioObject.Parameters.get('serverAccessPath');
this._secureToken = pydioObject.Parameters.get('SECURE_TOKEN');
}

setSecureToken(token){
this._secureToken = token;
}

request(parameters, onComplete=null, onError=null, settings={}){
Expand Down Expand Up @@ -126,7 +120,7 @@ class PydioApi{
document.location.href=downloadUrl;
}else{

let parameters = {...additionalParameters, secure_token:this._secureToken, get_action: dlActionName};
let parameters = {...additionalParameters, secure_token:this._pydioObject.Parameters.get("SECURE_TOKEN"), get_action: dlActionName};
const minisite_session = PydioApi.detectMinisiteSession(ajxpServerAccess);
if(minisite_session){
parameters['minisite_session'] = minisite_session;
Expand Down Expand Up @@ -244,7 +238,7 @@ class PydioApi{
const cB = function(transport){
if(transport.responseJSON && transport.responseJSON.SECURE_TOKEN){
this._pydioObject.Parameters.set('SECURE_TOKEN', transport.responseJSON.SECURE_TOKEN);
this.setSecureToken(transport.responseJSON.SECURE_TOKEN);
Connexion.updateServerAccess(this._pydioObject.Parameters)
}
if(completeCallback) {
completeCallback(transport);
Expand Down

0 comments on commit db7854e

Please sign in to comment.