Clean up the error code when the OAuth user is not authorized.

pull/2194/head
Jamie 7 years ago
parent 73340d4fb6
commit d443efd8ea

@ -2,6 +2,7 @@
import { ActivatedRoute, Router } from "@angular/router";
import { AuthService } from "../auth/auth.service";
import { NotificationService } from "../services";
@Component({
templateUrl: "./loginoauth.component.html",
@ -11,7 +12,7 @@ export class LoginOAuthComponent implements OnInit {
public error: string;
constructor(private authService: AuthService, private router: Router,
private route: ActivatedRoute) {
private route: ActivatedRoute, private notify: NotificationService) {
this.route.params
.subscribe((params: any) => {
this.pin = params.pin;
@ -37,6 +38,10 @@ export class LoginOAuthComponent implements OnInit {
this.error = x.errorMessage;
}
}, err => {
this.notify.error(err.statusText);
this.router.navigate(["login"]);
});
}
}

Loading…
Cancel
Save