Skip to content

Commit

Permalink
Added redirecting if user is not logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonpoltorak committed Mar 17, 2024
1 parent 688d820 commit afe1abf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions corn-frontend/src/app/pages/boards/boards.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ export class BoardsComponent implements OnInit {
}
});
this.isLoggedIn = this.keycloak.isLoggedIn();

if (this.isLoggedIn) {
this.userProfile = await this.keycloak.loadUserProfile();
console.log(this.userProfile);
} else {
this.router.navigate([RouterPaths.HOME_DIRECT_PATH]);
}
}

Expand All @@ -88,7 +90,8 @@ export class BoardsComponent implements OnInit {
}

logout(): void {
this.keycloak.logout();
this.keycloak
.logout();
}

}

0 comments on commit afe1abf

Please sign in to comment.