Refactor auth module.

- Switch from form to text field for passphrase input.
- Refactor error dialog format.
- Send dialog on incorrect parsing of private key.
- Refactor block sync service to take parameters.
This commit is contained in:
Spencer Ofwiti
2021-03-16 13:08:18 +03:00
parent 9fa9852ded
commit 12f4d328bf
15 changed files with 82 additions and 75 deletions

View File

@@ -16,16 +16,13 @@ export class ErrorInterceptor implements HttpInterceptor {
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
return next.handle(request).pipe(catchError((err: HttpErrorResponse) => {
const data = {
this.errorDialogService.openDialog({
message: err.error.message || err.statusText,
reason: err && err.error && err.error.reason ? err.error.reason : '',
status: err.status
};
this.errorDialogService.openDialog(data);
});
if ([401, 403].indexOf(err.status) !== -1) {
location.reload(true);
}
// const error = err.error.message || err.statusText;
return throwError(err);
}));
}