Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
enasequence
webin-portal
Commits
d96b82a6
Commit
d96b82a6
authored
Apr 25, 2019
by
Rasko Leinonen
Browse files
Excluded checklist endpoints from authentication interception.
parent
ff6791a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
frontend/src/app/webin-authentication.interceptor.ts
frontend/src/app/webin-authentication.interceptor.ts
+6
-12
No files found.
frontend/src/app/webin-authentication.interceptor.ts
View file @
d96b82a6
...
...
@@ -23,20 +23,14 @@ export class WebinAuthenticationInterceptor implements HttpInterceptor {
intercept
(
req
:
HttpRequest
<
any
>
,
next
:
HttpHandler
):
Observable
<
HttpEvent
<
any
>>
{
if
(
!
req
.
url
.
startsWith
(
environment
.
webinAuthenticationServiceUrl
))
{
console
.
log
(
req
.
url
);
if
(
!
req
.
url
.
startsWith
(
environment
.
webinAuthenticationServiceUrl
)
&&
!
req
.
url
.
startsWith
(
environment
.
webinReportServiceUrl
+
"
/checklist-groups
"
)
&&
!
req
.
url
.
startsWith
(
environment
.
webinReportServiceUrl
+
"
/checklists
"
))
{
// console.log('Webin authentication interceptor');
const
webinAuthenticationService
=
this
.
injector
.
get
(
WebinAuthenticationService
);
/* if (req.url.startsWith(environment.webinReportServiceUrl)) {
*/
const
authReq
=
req
.
clone
({
headers
:
req
.
headers
.
set
(
'
Authorization
'
,
webinAuthenticationService
.
getAuthorizationTokenHeader
())});
return
next
.
handle
(
authReq
);
/* }
else {
const authReq = req.clone({headers: req.headers.set('Authorization', webinAuthenticationService.getAuthorizationHeader())});
return next.handle(authReq);
}
*/
const
authReq
=
req
.
clone
({
headers
:
req
.
headers
.
set
(
'
Authorization
'
,
webinAuthenticationService
.
getAuthorizationTokenHeader
())});
return
next
.
handle
(
authReq
);
}
else
{
return
next
.
handle
(
req
);
...
...
Write
Preview
Markdown
is supported
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