-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require authentication for admin and profile pages
- Loading branch information
lmarkus
committed
Dec 31, 2013
1 parent
709e917
commit 595989c
Showing
3 changed files
with
11 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
'use strict'; | ||
|
||
|
||
var AdminModel = require('../models/admin'); | ||
var AdminModel = require('../models/admin'), | ||
auth = require('../lib/auth'); | ||
|
||
|
||
module.exports = function (app) { | ||
|
||
var model = new AdminModel(); | ||
|
||
|
||
app.get('/admin', function (req, res) { | ||
app.get('/admin', auth.isAuthenticated('admin'), function (req, res) { | ||
|
||
res.render('admin', model); | ||
|
||
}); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
'use strict'; | ||
|
||
|
||
var ProfileModel = require('../models/profile'); | ||
var ProfileModel = require('../models/profile'), | ||
auth = require('../lib/auth'); | ||
|
||
|
||
module.exports = function (app) { | ||
|
||
var model = new ProfileModel(); | ||
|
||
|
||
app.get('/profile', function (req, res) { | ||
app.get('/profile', auth.isAuthenticated(), function (req, res) { | ||
|
||
res.render('profile', model); | ||
|
||
}); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters