From d443efd8eaa071cb961adc0cf3aaae0deaa63610 Mon Sep 17 00:00:00 2001 From: Jamie Date: Wed, 25 Apr 2018 20:50:34 +0100 Subject: [PATCH] Clean up the error code when the OAuth user is not authorized. --- src/Ombi/ClientApp/app/login/loginoauth.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Ombi/ClientApp/app/login/loginoauth.component.ts b/src/Ombi/ClientApp/app/login/loginoauth.component.ts index 1adcff19c..21b591399 100644 --- a/src/Ombi/ClientApp/app/login/loginoauth.component.ts +++ b/src/Ombi/ClientApp/app/login/loginoauth.component.ts @@ -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"]); }); } }