Skip to content

Commit 7fd8e89

Browse files
committed
[DSC-2329] Fix issue with retrieving XSRF token
1 parent 021c835 commit 7fd8e89

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
@@ -17,6 +17,7 @@ import {
1717
import { map } from 'rxjs/operators';
1818
import { Observable } from 'rxjs';
1919
import { XSRFService } from '../xsrf/xsrf.service';
20+
import { RESTURLCombiner } from '../url-combiner/rest-url-combiner';
2021

2122
/**
2223
* Server side version of the service to send authentication requests
@@ -41,8 +42,8 @@ export class ServerAuthRequestService extends AuthRequestService {
4142
* @protected
4243
*/
4344
protected createShortLivedTokenRequest(href: string): Observable<PostRequest> {
44-
// First do a call to the root endpoint in order to get an XSRF token
45-
return this.httpClient.get(this.halService.getRootHref(), { observe: 'response' }).pipe(
45+
// First do a call to the csrf endpoint in order to get an XSRF token
46+
return this.httpClient.get(new RESTURLCombiner('/security/csrf').toString(), { observe: 'response' }).pipe(
4647
// retrieve the XSRF token from the response header
4748
map((response: HttpResponse<any>) => response.headers.get(XSRF_RESPONSE_HEADER)),
4849
map((xsrfToken: string) => {

0 commit comments

Comments
 (0)