Mantis 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.

Disable Authentication Temporary

Disabling authentication temporarily is generally not recommended due to security risks. However, if you have a specific scenario where you need to disable authentication for a short period, here are some steps you can follow:

  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 { AdminLayout } from './theme/layout/admin-layout/admin-layout.component';
import { GuestLayouts } from './theme/layout/guest-layout/guest-layout.component';
// import { AuthGuardChild } from './theme/shared/components/_helpers/auth.guard';
import { SimpleLayouts } from './theme/layout/simple-layout/simple-layout.component';
import { Role } from './theme/shared/components/_helpers/role';

const routes: Routes = [
 
    {
      path: '',
      component: GuestLayouts,
      children: [
         ....
     
        {
          path: 'auth',
          // canActivateChild: [AuthGuardChild],
          loadChildren: () => import('./demo/pages/authentication/authentication.module').then((m) => m.AuthenticationModule),
          data: {
            roles: [Role.Admin, Role.User]
          }
        },
        {
          path: 'maintenance',
          // canActivateChild: [AuthGuardChild],
          loadChildren: () => import('./demo/pages/maintenance/maintenance.module').then((m) => m.MaintenanceModule),
          data: {
            roles: [Role.Admin, Role.User]
          }
        }
      ]
    },
    {
        path: '',
        component: AdminComponent,
        // canActivateChild: [AuthGuardChild], <!-- Commented to AuthGuardChild -->
        children: [
           ....
        ]
     },
     {
          path: '',
          component: SimpleLayouts,
          children: [
              {
                path: 'components',
                loadChildren: () => import('./theme/layout/simple-layout/com-navigation/com-navigation.module').then((m) => m.ComNavigationModule)
              },
              {
                path: 'contact-us',
                // canActivateChild: [AuthGuardChild],
                loadComponent: () => import('./demo/pages/contact-us/contact-us.component').then((c) => c.ContactUsComponent)
              }
          ]
      },
      ...
]
  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-primary mt-3" target="_blank">
       <i class="me-1" antIcon theme="outline" type="eye"></i>
        Live Preview
    </a>

To:
 
    <a [routerLink]="['/dashboard/default']" class="btn btn-primary mt-3" target="_blank">
       <i class="me-1" antIcon theme="outline" type="eye"></i>
        Live Preview
    </a>
PreviousLogin as First PageNextRemove Role Base Authentication

Last updated 4 months ago

✏️