Revision 60585
Added by Konstantinos Triantafyllou about 3 years ago
modules/uoa-services-library/trunk/ng-openaire-library/src/app/error-interceptor.service.ts | ||
---|---|---|
11 | 11 |
@Injectable() |
12 | 12 |
export class ErrorInterceptorService implements HttpInterceptor { |
13 | 13 |
|
14 |
private static UNAUTHORIZED_WHITELIST = [properties.userInfoUrl, properties.orcidAPIURL]; |
|
14 |
private static UNAUTHORIZED_WHITELIST = [properties.userInfoUrl, properties.orcidAPIURL, properties.registryUrl + 'verification/'];
|
|
15 | 15 |
|
16 | 16 |
constructor(private router: Router) { |
17 | 17 |
} |
... | ... | |
21 | 21 |
if ((err.status === 0 && properties.registryUrl && this.isService(req, properties.registryUrl)) || |
22 | 22 |
(err.status === 401 && !this.isService(req, ErrorInterceptorService.UNAUTHORIZED_WHITELIST))) { |
23 | 23 |
this.logOut(); |
24 |
} else if(err.status === 403) { |
|
24 |
} else if(err.status === 403 && !this.isService(req, ErrorInterceptorService.UNAUTHORIZED_WHITELIST)) {
|
|
25 | 25 |
this.unauthorized(); |
26 | 26 |
} |
27 | 27 |
return throwError(err); |
modules/uoa-services-library/trunk/ng-openaire-library/src/app/sharedComponents/input/input.component.ts | ||
---|---|---|
117 | 117 |
<span *ngIf="formControl.invalid && formControl.touched" class="uk-text-danger input-message"> |
118 | 118 |
<span *ngIf="formControl.errors.error">{{formControl.errors.error}}</span> |
119 | 119 |
<span *ngIf="type === 'URL' || type === 'logoURL'">Please provide a valid URL (e.g. https://example.com)</span> |
120 |
</span> |
|
121 |
<span class="uk-text-danger input-message"> |
|
120 | 122 |
<ng-content select="[error]"></ng-content> |
121 | 123 |
</span> |
122 | 124 |
<span *ngIf="formControl.valid" class="uk-text-warning input-message"> |
Also available in: Unified diff
[Library | Trunk]: Fix custom error on input. Add verification urls on whitelist of error service interceptor