File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66import { Injectable } from '@angular/core' ;
77import { Observable } from 'rxjs' ;
88import { map } from 'rxjs/operators' ;
9+ import { RESTURLCombiner } from 'src/app/core/url-combiner/rest-url-combiner' ;
910
1011import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service' ;
1112import { 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 ) => {
You can’t perform that action at this time.
0 commit comments