Berry - Angular
  • ✨Introduction
  • 🚀Quick Installation
  • 📂Directory Structure
  • 📄Page Structure
  • 📒Theme Configuration
  • 🎨Theme Layouts
  • 📚How to
    • Dashboard as First Page
    • Login as First Page
    • Remove Authentication
    • Remove Role Base Authentication
    • Guard Children Routes
    • Role Base Authentication
  • 📦Dependencies
  • 🆘Support
  • 📅Changelog
Powered by GitBook
On this page
  1. How to

Remove Authentication

How to remove authentication login page.

This section explains how to bypass the login page and go directly to the dashboard page.

  1. Update route at: src/app/app-routing.module.ts

src/app/app-routing.module.ts
```
// Angular Imports
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

// project import
import { AdminComponent } from './theme/layout/admin/admin.component';
import { GuestComponent } from './theme/layout/guest/guest.component';
// import { AuthGuardChild } from './theme/shared/_helpers/auth.guard';
import { Role } from './theme/shared/_helpers/role';

const routes: Routes = [
    ....
    {
        path: '',
        component: AdminComponent,
        // canActivateChild: [AuthGuardChild], <!-- Commented to AuthGuardChild -->
        children: [
          {
            path: '',
            loadComponent: () => import('./demo/dashboard/default/default.component').then((c) => c.DefaultComponent),
            data: { roles: [Role.Admin, Role.User] }
          },
          ....
        ]
     },
     ...
]
  1. Changed the navigation path from the landing page to the login page, to now redirect from the landing page to the dashboard page

src/app/demo/pages/landing/landing.component.html
Form: 

<a [routerLink]="['/login']" class="btn btn-secondary me-2">
    <div class="d-flex alien-item-center">
       <i class="ti ti-player-play-filled me-2"></i>
       <span>Live Preview</span>
    </div>
</a>

To: 

<a [routerLink]="['/default']" class="btn btn-secondary me-2">
    <div class="d-flex alien-item-center">
       <i class="ti ti-player-play-filled me-2"></i>
       <span>Live Preview</span>
    </div>
</a>
PreviousLogin as First PageNextRemove Role Base Authentication

Last updated 5 months ago

📚