Documentation update.
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
|
||||
<link rel="stylesheet" href="../styles/style.css">
|
||||
<link rel="stylesheet" href="../styles/style.css">
|
||||
<link rel="stylesheet" href="../styles/dark.css" media="(prefers-color-scheme: dark)">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -39,7 +40,7 @@
|
||||
|
||||
<ol class="breadcrumb">
|
||||
<li>Interceptors</li>
|
||||
<li>HttpConfigInterceptor</li>
|
||||
<li >HttpConfigInterceptor</li>
|
||||
</ol>
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
@@ -60,11 +61,12 @@
|
||||
<code>src/app/_interceptors/http-config.interceptor.ts</code>
|
||||
</p>
|
||||
|
||||
|
||||
<p class="comment">
|
||||
<h3>Description</h3>
|
||||
</p>
|
||||
<p class="comment">
|
||||
<p>Intercepts and handles setting of configurations to outgoing HTTP request. </p>
|
||||
<p>Intercepts and handles setting of configurations to outgoing HTTP request.</p>
|
||||
|
||||
</p>
|
||||
|
||||
@@ -83,7 +85,7 @@
|
||||
<td class="col-md-4">
|
||||
<ul class="index-list">
|
||||
<li>
|
||||
<a href="#intercept">intercept</a>
|
||||
<a href="#intercept" >intercept</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
@@ -108,13 +110,13 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="10" class="link-to-prism">src/app/_interceptors/http-config.interceptor.ts:10</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="11" class="link-to-prism">src/app/_interceptors/http-config.interceptor.ts:11</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>Initialization of http config interceptor. </p>
|
||||
<div class="io-description"><p>Initialization of http config interceptor.</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -133,24 +135,22 @@
|
||||
<td class="col-md-4">
|
||||
<a name="intercept"></a>
|
||||
<span class="name">
|
||||
<b>
|
||||
intercept
|
||||
</b>
|
||||
<span ><b>intercept</b></span>
|
||||
<a href="#intercept"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<code>intercept(request: HttpRequest<unknown>, next: <a href="https://angular.io/api/common/http/HttpHandler" target="_blank">HttpHandler</a>)</code>
|
||||
<code>intercept(request: HttpRequest<>, next: <a href="https://angular.io/api/common/http/HttpHandler" target="_blank">HttpHandler</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="21"
|
||||
class="link-to-prism">src/app/_interceptors/http-config.interceptor.ts:21</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="22"
|
||||
class="link-to-prism">src/app/_interceptors/http-config.interceptor.ts:22</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
<tr>
|
||||
<td>request</td>
|
||||
<td>
|
||||
<code>HttpRequest<unknown></code>
|
||||
<code>HttpRequest<></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@@ -214,7 +214,7 @@
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<HttpEvent<unknown>></code>
|
||||
<b>Returns : </b> <code>Observable<HttpEvent<>></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
@@ -236,6 +236,7 @@ import { Injectable } from '@angular/core';
|
||||
|
||||
// Third party imports
|
||||
import { Observable } from 'rxjs';
|
||||
import { environment } from '@src/environments/environment';
|
||||
|
||||
/** Intercepts and handles setting of configurations to outgoing HTTP request. */
|
||||
@Injectable()
|
||||
@@ -251,11 +252,18 @@ export class HttpConfigInterceptor implements HttpInterceptor {
|
||||
* @returns The forwarded request.
|
||||
*/
|
||||
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
|
||||
// const token: string = sessionStorage.getItem(btoa('CICADA_SESSION_TOKEN'));
|
||||
if (
|
||||
request.url.startsWith(environment.cicMetaUrl) ||
|
||||
request.url.startsWith(environment.cicUssdUrl)
|
||||
) {
|
||||
const token: string = sessionStorage.getItem(btoa('CICADA_SESSION_TOKEN'));
|
||||
|
||||
// if (token) {
|
||||
// request = request.clone({headers: request.headers.set('Authorization', 'Bearer ' + token)});
|
||||
// }
|
||||
if (token) {
|
||||
request = request.clone({
|
||||
headers: request.headers.set('Authorization', 'Bearer ' + token),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return next.handle(request);
|
||||
}
|
||||
@@ -297,9 +305,9 @@ export class HttpConfigInterceptor implements HttpInterceptor {
|
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script>
|
||||
<script src="../js/libs/lit-html.js"></script>
|
||||
<!-- Required to polyfill modern browsers as code is ES5 for IE... -->
|
||||
<script src="../js/libs/custom-elements-es5-adapter.js" charset="utf-8" defer></script>
|
||||
<script src="../js/menu-wc.js" defer></script>
|
||||
|
||||
<script type="module" src="../js/menu-wc.js" defer></script>
|
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
||||
|
||||
<script src="../js/libs/bootstrap-native.js"></script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user