mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Refactoring of auth.interceptor
This commit is contained in:
@@ -76,6 +76,7 @@ const ENTITY_IMPORTS = [
|
||||
IMPORTS.push(
|
||||
StoreDevtoolsModule.instrument({
|
||||
maxAge: 100,
|
||||
// logOnly: false,
|
||||
logOnly: ENV_CONFIG.production,
|
||||
})
|
||||
);
|
||||
|
@@ -41,7 +41,9 @@ export class AuthRequestService {
|
||||
public postToEndpoint(method: string, body: any, options?: HttpOptions): Observable<any> {
|
||||
return this.halService.getEndpoint(this.linkName).pipe(
|
||||
filter((href: string) => isNotEmpty(href)),
|
||||
tap((href: string) => console.log('This is href in postToEndpoint(): ' , href)),
|
||||
map((endpointURL) => this.getEndpointByMethod(endpointURL, method)),
|
||||
tap((href2) => {console.log('href2', href2)}),
|
||||
distinctUntilChanged(),
|
||||
map((endpointURL: string) => new AuthPostRequest(this.requestService.generateRequestId(), endpointURL, body, options)),
|
||||
tap((request: PostRequest) => this.requestService.configure(request, true)),
|
||||
|
@@ -154,10 +154,10 @@ export class AuthInterceptor implements HttpInterceptor {
|
||||
console.log('error.headers.get("location"): ', location);
|
||||
|
||||
console.log('www-authenticate', error.headers.get('www-authenticate'));
|
||||
let strings = error.headers.get('www-authenticate').split(',');
|
||||
let string = strings[1];
|
||||
let s = string.replace('location=', '');
|
||||
let s1 = s.replace('"', '').trim();
|
||||
const strings = error.headers.get('www-authenticate').split(',');
|
||||
const locationstring = strings[1];
|
||||
const s = locationstring.replace('location=', '');
|
||||
const s1 = s.replace('"', '').trim();
|
||||
console.log('This should be the location: ', s1);
|
||||
location = s1;
|
||||
|
||||
|
@@ -27,6 +27,9 @@
|
||||
<a class="btn btn-lg btn-primary btn-block mt-2" [href]="(ssoLoginUrl | async)" role="button">{{"login.form.ssoLogin" | translate}}</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#">{{"login.form.new-user" | translate}}</a>
|
||||
<a class="dropdown-item" href="#">{{"login.form.forgot-password" | translate}}</a>
|
||||
|
Reference in New Issue
Block a user