added signup template and logout route
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
exports.index = function(req, res){
|
||||
res.render('index');
|
||||
res.render('index', { user: req.user });
|
||||
};
|
||||
|
||||
exports.partials = function (req, res) {
|
||||
|
@@ -15,6 +15,9 @@ angular.module('myApp', ['ngRoute', 'myApp.filters', 'myApp.services', 'myApp.di
|
||||
$routeProvider.when('/login', {
|
||||
templateUrl: 'partials/login',
|
||||
controller: MyCtrl3
|
||||
});
|
||||
$routeProvider.when('/logout', {
|
||||
|
||||
});
|
||||
$routeProvider.otherwise({ redirectTo: '/view1' });
|
||||
$locationProvider.html5Mode(true);
|
||||
|
@@ -48,7 +48,6 @@ app.post('/login', users.postlogin);
|
||||
//app.get('/admin', auth.ensureAuthenticated, auth.ensureAdmin(), users.admin);
|
||||
//app.get('/api/name', api.name);
|
||||
app.get('/partials/login', users.getlogin);
|
||||
|
||||
app.get('/partials/:name', home.partials);
|
||||
|
||||
app.get('*', home.index);
|
||||
|
@@ -14,8 +14,14 @@ block body
|
||||
a(href="view1") View1
|
||||
li
|
||||
a(href="view2") View2
|
||||
if !user
|
||||
li
|
||||
a(href="login") login
|
||||
else
|
||||
li
|
||||
a(href='#') Welcome
|
||||
li
|
||||
a(href='logout') Logout
|
||||
.container
|
||||
div(ng-controller='AppCtrl')
|
||||
.jumbotron
|
||||
|
14
views/partials/signup.jade
Normal file
14
views/partials/signup.jade
Normal file
@@ -0,0 +1,14 @@
|
||||
if message
|
||||
p= message
|
||||
form(action='/login', method='post')
|
||||
div
|
||||
label Username:
|
||||
input(type='text', name='username')
|
||||
br
|
||||
div
|
||||
label Password:
|
||||
input(type='password', name='password')
|
||||
div
|
||||
input(type='submit', value='Submit')
|
||||
p
|
||||
small Hint - bob:secret
|
Reference in New Issue
Block a user