mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-17 07:50:12 +01:00
feat(auth): auth pages added
This commit is contained in:
parent
210c6f2355
commit
75dd743244
6 changed files with 73 additions and 4 deletions
|
|
@ -24,7 +24,8 @@
|
||||||
"testTsconfig": "tsconfig.spec.json",
|
"testTsconfig": "tsconfig.spec.json",
|
||||||
"styles": [
|
"styles": [
|
||||||
"../node_modules/ionicons/scss/ionicons.scss",
|
"../node_modules/ionicons/scss/ionicons.scss",
|
||||||
"../node_modules/font-awesome/scss/font-awesome.scss"
|
"../node_modules/font-awesome/scss/font-awesome.scss",
|
||||||
|
"./app/@theme/styles/styles.scss"
|
||||||
],
|
],
|
||||||
"scripts": [
|
"scripts": [
|
||||||
"../node_modules/tinymce/tinymce.js",
|
"../node_modules/tinymce/tinymce.js",
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
// @nebular our of the box themes
|
// @nebular our of the box themes
|
||||||
@import '~@nebular/theme/styles/themes';
|
@import '~@nebular/theme/styles/themes';
|
||||||
|
|
||||||
|
// TODO: rename into themes
|
||||||
|
|
||||||
// which themes you what to enable (empty to enable all - not recommended)
|
// which themes you what to enable (empty to enable all - not recommended)
|
||||||
$nb-enabled-themes: (default, light, cosmic);
|
$nb-enabled-themes: (default, light, cosmic);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,46 @@
|
||||||
import { ExtraOptions, RouterModule, Routes } from '@angular/router';
|
import { ExtraOptions, RouterModule, Routes } from '@angular/router';
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
|
import {
|
||||||
|
NgaAuthComponent,
|
||||||
|
NgaLoginComponent,
|
||||||
|
NgaLogoutComponent,
|
||||||
|
NgaRegisterComponent,
|
||||||
|
NgaRequestPasswordComponent,
|
||||||
|
NgaResetPasswordComponent
|
||||||
|
} from '@akveo/nga-auth';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
// {path: 'admin'}
|
|
||||||
{ path: 'pages', loadChildren: 'app/pages/pages.module#PagesModule' },
|
{ path: 'pages', loadChildren: 'app/pages/pages.module#PagesModule' },
|
||||||
|
{
|
||||||
|
path: 'auth',
|
||||||
|
component: NgaAuthComponent,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: NgaLoginComponent,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'login',
|
||||||
|
component: NgaLoginComponent,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'register',
|
||||||
|
component: NgaRegisterComponent,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'logout',
|
||||||
|
component: NgaLogoutComponent,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'request-password',
|
||||||
|
component: NgaRequestPasswordComponent,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'reset-password',
|
||||||
|
component: NgaResetPasswordComponent,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{ path: '', redirectTo: 'pages', pathMatch: 'full' },
|
{ path: '', redirectTo: 'pages', pathMatch: 'full' },
|
||||||
{ path: '**', redirectTo: 'pages' },
|
{ path: '**', redirectTo: 'pages' },
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import { BrowserModule } from '@angular/platform-browser';
|
||||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { HttpModule } from '@angular/http';
|
import { HttpModule } from '@angular/http';
|
||||||
|
import { NgaAuthModule, NgaDummyAuthProvider } from '@akveo/nga-auth';
|
||||||
import { CoreModule } from './@core/core.module';
|
import { CoreModule } from './@core/core.module';
|
||||||
|
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
|
|
@ -25,6 +25,20 @@ import { ThemeModule } from './@theme/theme.module';
|
||||||
CoreModule,
|
CoreModule,
|
||||||
ThemeModule.forRoot(),
|
ThemeModule.forRoot(),
|
||||||
CoreModule.forRoot(),
|
CoreModule.forRoot(),
|
||||||
|
NgaAuthModule,
|
||||||
|
NgaAuthModule.forRoot({
|
||||||
|
providers: {
|
||||||
|
email: {
|
||||||
|
service: NgaDummyAuthProvider,
|
||||||
|
config: {
|
||||||
|
delay: 1000,
|
||||||
|
login: {
|
||||||
|
rememberMe: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
providers: [
|
providers: [
|
||||||
|
|
|
||||||
|
|
@ -99,4 +99,20 @@ export const MENU_ITEMS: List<NbMenuItem> = List([{
|
||||||
title: 'Smart Table',
|
title: 'Smart Table',
|
||||||
link: '/pages/tables/smart-table',
|
link: '/pages/tables/smart-table',
|
||||||
}]),
|
}]),
|
||||||
|
}, {
|
||||||
|
title: 'Auth',
|
||||||
|
icon: 'ion-unlocked',
|
||||||
|
children: List<NgaMenuItem>([{
|
||||||
|
title: 'Login',
|
||||||
|
link: '/auth/login',
|
||||||
|
}, {
|
||||||
|
title: 'Register',
|
||||||
|
link: '/auth/register',
|
||||||
|
}, {
|
||||||
|
title: 'Request Password',
|
||||||
|
link: '/auth/request-password',
|
||||||
|
}, {
|
||||||
|
title: 'Reset Password',
|
||||||
|
link: '/auth/reset-password',
|
||||||
|
}]),
|
||||||
}]);
|
}]);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
import 'style-loader!../@theme/styles/styles.scss';
|
|
||||||
import { MENU_ITEMS } from './pages-menu';
|
import { MENU_ITEMS } from './pages-menu';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue