feat: Update sidebar navigation and add dashboard component
- Changed display name for the main dashboard in sidebar from 'Dashboards' to 'Hlavná stránka'. - Removed commented-out children routes for dashboards and frontend pages in sidebar. - Added new dashboard component and its routing. - Introduced logout functionality with a dedicated logout component. - Updated authentication routes to include logout path. - Modified callback component to navigate to the dashboard upon successful login. - Enhanced authentication service to handle user profile loading more effectively.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { Router, RouterModule } from '@angular/router';
|
||||
import { CoreService } from '../../../services/core.service';
|
||||
import { MaterialModule } from '../../../material.module';
|
||||
import { BrandingComponent } from '../../../layouts/full/vertical/sidebar/branding.component';
|
||||
@@ -15,7 +15,7 @@ export class CallbackComponent {
|
||||
options: any;
|
||||
profile: any;
|
||||
|
||||
constructor(private settings: CoreService, private as: AuthenticationService) {
|
||||
constructor(private settings: CoreService, private as: AuthenticationService, private router: Router) {
|
||||
this.options = this.settings.getOptions();
|
||||
|
||||
// Handle the OAuth2 callback and load user profile
|
||||
@@ -24,6 +24,7 @@ export class CallbackComponent {
|
||||
.then(_ => {
|
||||
console.log('Login successful');
|
||||
this.profile = this.as.profile;
|
||||
this.router.navigate(['/dashboard']);
|
||||
}).catch(err => {
|
||||
console.error('Error handling callback', err);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user