Skip to content

Commit 0e50583

Browse files
author
Jeppe Elkjær Jørgensen
committed
IOT-44 changed loginlogic to check for accessToken before routing
1 parent db13315 commit 0e50583

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/app/admin/users/user-edit/user-edit.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
{{'USERS.FORM.ACTIVE' | translate}}</mat-slide-toggle>
4242
</div>
4343
<div class="row mb-3">
44-
<mat-slide-toggle [(ngModel)]="user.globalAdmin" id="permission" name="permission">
44+
<mat-slide-toggle [(ngModel)]="user.globalAdmin" id="globalAdmin" name="globalAdmin">
4545
{{'USERS.FORM.GLOBAL-ADMIN' | translate}}</mat-slide-toggle>
4646
</div>
4747
<div class="form-group mt-5 clearfix">

src/app/auth/auth.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ export class AuthComponent implements OnInit {
5252
this.authService.login(username, password).subscribe(
5353
(x: any) => {
5454
console.log(x);
55-
if (x == 401) {
56-
this.fail();
57-
} else {
55+
if (x.accessToken) {
5856
this.success();
57+
} else {
58+
this.fail();
5959
}
6060
},
6161
(err) => {

0 commit comments

Comments
 (0)