mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 21:33:15 -07:00
Small user changes #865
This commit is contained in:
parent
b4789363e8
commit
8a98761fec
3 changed files with 12 additions and 18 deletions
|
@ -34,6 +34,8 @@ export class AppComponent implements OnInit {
|
|||
this.settingsService.getCustomization().subscribe(x => this.customizationSettings = x);
|
||||
|
||||
this.router.events.subscribe(() => {
|
||||
|
||||
this.user = this.authService.claims();
|
||||
this.showNav = this.authService.loggedIn();
|
||||
});
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ export class AuthService extends ServiceHelpers {
|
|||
var u = { name: name, roles: [] as string[] };
|
||||
if (roles instanceof Array) {
|
||||
|
||||
u.roles.concat(roles);
|
||||
u.roles = roles;
|
||||
} else {
|
||||
u.roles.push(roles);
|
||||
}
|
||||
|
|
|
@ -29,11 +29,6 @@ export class LoginComponent {
|
|||
this.authService.login({ password: this.password, username: this.username })
|
||||
.subscribe(x => {
|
||||
localStorage.setItem("id_token", x.access_token);
|
||||
localStorage.setItem('currentUser', this.username);
|
||||
|
||||
this.identityService.getUser().subscribe(r => {
|
||||
localStorage.setItem("roles", JSON.stringify(r.claims));
|
||||
localStorage.setItem("user", JSON.stringify(r));
|
||||
|
||||
if (this.authService.loggedIn()) {
|
||||
this.router.navigate(['search']);
|
||||
|
@ -41,10 +36,7 @@ export class LoginComponent {
|
|||
this.notify.error("Could not log in", "Incorrect username or password");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}, err => this.notify.error("Could not log in", "Incorrect username or password"));
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue