Skip to content

Commit

Permalink
Remove the jwt from the QP
Browse files Browse the repository at this point in the history
Send the JWT via headers, not as query parameter
  • Loading branch information
avichai-exlibris committed Jun 8, 2023
1 parent 58f7031 commit d75d090
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions cloudapp/src/app/service/InCites.api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { BaseService } from './base.service';
export class InCitesApiService extends BaseService {
private _toConnect : boolean;
private _isQueryParamsNeeded : boolean = false;
private _authorization : any;

constructor(
protected eventsService: CloudAppEventsService,
Expand All @@ -33,7 +32,6 @@ export class InCitesApiService extends BaseService {
}),
mergeMap(authToken => {
let headers = this.setAuthHeader(authToken);
this._authorization = headers.Authorization;
return this.http.post<any>(fullUrl, { headers })
})
);
Expand All @@ -50,30 +48,27 @@ export class InCitesApiService extends BaseService {
}),
mergeMap(authToken => {
let headers = this.setAuthHeader(authToken);
this._authorization = headers.Authorization;
return this.http.get<any>(fullUrl, { })
return this.http.get<any>(fullUrl, { headers })
})
);
}

setBaseUrl(initData: InitData) : string {
let baseUrl = super.setBaseUrl(initData);
baseUrl = baseUrl + "inCites?";
if (this._isQueryParamsNeeded) {
if(this._isQueryParamsNeeded) {
baseUrl = baseUrl + this.getQueryParams();

}
return baseUrl;
}

private getQueryParams() :string{
let urlParams = "";
urlParams = urlParams + QueryParams.Optin + "=" + this._toConnect +"&" + QueryParams.Jwt + "=" + this._authorization;
urlParams = urlParams + QueryParams.Optin + "=" + this._toConnect;
return urlParams;
}
}

export enum QueryParams {
Optin = "optin",
Jwt = "jwt"
Optin = "optin"
}

0 comments on commit d75d090

Please sign in to comment.