Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
web-et-numerique
web-et-numerique-internet
data.grandlyon.com
web-portal
components
custom-apps
web-app
Commits
495e6c50
Commit
495e6c50
authored
Feb 15, 2022
by
Matthieu BENOIST
Browse files
Merge branch 'DOS0177823' into 'master'
Remove xsrf token from photon calls See merge request
!160
parents
bbbef0bb
06afc092
Pipeline
#21412
passed with stage
in 8 minutes and 10 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/app/user/interceptors/xsrf-token.interceptor.ts
View file @
495e6c50
...
...
@@ -3,6 +3,7 @@ import { Injectable } from '@angular/core';
import
{
Observable
}
from
'
rxjs
'
;
import
{
CookieService
}
from
'
ngx-cookie-service
'
;
import
{
APP_CONFIG
}
from
'
../../core/services/app-config.service
'
;
import
{
PasswordResetComponent
}
from
'
../components
'
;
@
Injectable
()
export
class
XSRFTokenInterceptor
implements
HttpInterceptor
{
...
...
@@ -17,7 +18,8 @@ export class XSRFTokenInterceptor implements HttpInterceptor {
let
request
=
req
;
if
(
xsrfToken
)
{
if
(
!
new
RegExp
(
`^
${
APP_CONFIG
.
backendUrls
.
datasetUsageStatistics
}
`
).
test
(
req
.
url
))
{
if
(
!
new
RegExp
(
`^
${
APP_CONFIG
.
backendUrls
.
datasetUsageStatistics
}
`
).
test
(
req
.
url
)
&&
!
new
RegExp
(
`^
${
APP_CONFIG
.
backendUrls
.
geocoder
}
`
).
test
(
req
.
url
)
)
{
request
=
req
.
clone
({
headers
:
req
.
headers
.
set
(
'
x-xsrf-token
'
,
xsrfToken
),
});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment