Skip to content

Commit 7fb5c66

Browse files
committed
[DSC-2329] Fix issue with retrieving XSRF token
1 parent da0111d commit 7fb5c66

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/app/core/auth/server-auth-request.service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
import { Injectable } from '@angular/core';
77
import { Observable } from 'rxjs';
88
import { map } from 'rxjs/operators';
9+
import { RESTURLCombiner } from 'src/app/core/url-combiner/rest-url-combiner';
910

1011
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
1112
import { PostRequest } from '../data/request.models';
@@ -42,8 +43,8 @@ export class ServerAuthRequestService extends AuthRequestService {
4243
* @protected
4344
*/
4445
protected createShortLivedTokenRequest(href: string): Observable<PostRequest> {
45-
// First do a call to the root endpoint in order to get an XSRF token
46-
return this.httpClient.get(this.halService.getRootHref(), { observe: 'response' }).pipe(
46+
// First do a call to the csrf endpoint in order to get an XSRF token
47+
return this.httpClient.get(new RESTURLCombiner('/security/csrf').toString(), { observe: 'response' }).pipe(
4748
// retrieve the XSRF token from the response header
4849
map((response: HttpResponse<any>) => response.headers.get(XSRF_RESPONSE_HEADER)),
4950
map((xsrfToken: string) => {

0 commit comments

Comments
 (0)