feat(auth): auth pages added

This commit is contained in:
Dmitry Nehaychik 2017-08-02 17:27:19 +03:00
parent 210c6f2355
commit 75dd743244
6 changed files with 73 additions and 4 deletions

View file

@ -24,7 +24,8 @@
"testTsconfig": "tsconfig.spec.json",
"styles": [
"../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": [
"../node_modules/tinymce/tinymce.js",

View file

@ -3,6 +3,8 @@
// @nebular our of the box themes
@import '~@nebular/theme/styles/themes';
// TODO: rename into themes
// which themes you what to enable (empty to enable all - not recommended)
$nb-enabled-themes: (default, light, cosmic);

View file

@ -1,9 +1,46 @@
import { ExtraOptions, RouterModule, Routes } from '@angular/router';
import { NgModule } from '@angular/core';
import {
NgaAuthComponent,
NgaLoginComponent,
NgaLogoutComponent,
NgaRegisterComponent,
NgaRequestPasswordComponent,
NgaResetPasswordComponent
} from '@akveo/nga-auth';
const routes: Routes = [
// {path: 'admin'}
{ 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' },
];

View file

@ -8,7 +8,7 @@ import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
import { HttpModule } from '@angular/http';
import { NgaAuthModule, NgaDummyAuthProvider } from '@akveo/nga-auth';
import { CoreModule } from './@core/core.module';
import { AppComponent } from './app.component';
@ -25,6 +25,20 @@ import { ThemeModule } from './@theme/theme.module';
CoreModule,
ThemeModule.forRoot(),
CoreModule.forRoot(),
NgaAuthModule,
NgaAuthModule.forRoot({
providers: {
email: {
service: NgaDummyAuthProvider,
config: {
delay: 1000,
login: {
rememberMe: true,
}
},
},
}
}),
],
bootstrap: [AppComponent],
providers: [

View file

@ -99,4 +99,20 @@ export const MENU_ITEMS: List<NbMenuItem> = List([{
title: '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',
}]),
}]);

View file

@ -1,6 +1,5 @@
import { Component } from '@angular/core';
import 'style-loader!../@theme/styles/styles.scss';
import { MENU_ITEMS } from './pages-menu';
@Component({