Skip to content
This repository has been archived by the owner on Dec 1, 2017. It is now read-only.

Commit

Permalink
Refactor login and logout route names to log-in and log-out.
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik Viswanathan committed Jul 24, 2012
1 parent 636dfec commit c58707a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions routes/auth.js
Expand Up @@ -7,7 +7,7 @@ module.exports = function(app, nconf, db) {
var confirmScaffoldExistence = utils.confirmScaffoldExistence(db);

// Log in to napkin
app.post('/login', function(req, res) {
app.post('/log-in', function(req, res) {
auth.verify(req, nconf, function(err, email) {
if (err) {
throw err;
Expand All @@ -29,7 +29,7 @@ module.exports = function(app, nconf, db) {
});

// Log in to project
app.post('/share/:userId/project/:projectId/screen/:screenId/login',
app.post('/share/:userId/project/:projectId/screen/:screenId/log-in',
extractSharedEmail, confirmScaffoldExistence, function(req, res) {
var projectId = req.project.id;
var screenId = req.screen.id;
Expand All @@ -53,7 +53,7 @@ module.exports = function(app, nconf, db) {
});

// Log out of napkin
app.get('/logout', function(req, res) {
app.get('/log-out', function(req, res) {
if (req.session) {
req.session.reset();
}
Expand All @@ -62,7 +62,7 @@ module.exports = function(app, nconf, db) {
});

// Log out of project
app.get('/share/:userId/project/:projectId/screen/:screenId/logout',
app.get('/share/:userId/project/:projectId/screen/:screenId/log-out',
extractSharedEmail, confirmScaffoldExistence, function(req, res) {
if (req.session && req.session.auth) {
delete req.session.auth[req.project.id];
Expand Down
2 changes: 1 addition & 1 deletion todo.txt
Expand Up @@ -6,7 +6,6 @@
======================

- Screens should disappear when active project is deleted
- Rename login to log-in and logout to log-out
- Validate action is an actual screen ID
- Improve sharing page sidebar
- Add links on sharing page for visibility and return to prototype
Expand All @@ -33,3 +32,4 @@
/ Fix submit links
/ Delete component while it is active
/ Implement auth for screen sharing page
/ Rename login to log-in and logout to log-out
4 changes: 2 additions & 2 deletions views/layout.jade
Expand Up @@ -23,10 +23,10 @@ html

if typeof(sharing) === 'undefined' || !sharing
if session.email
a(href='/logout', tabindex='-1')
a(href='/log-out', tabindex='-1')
img(src='/images/browser-id-sign-out.png', alt='Browser ID Sign Out')
else
form#login-form(method='post', action='/login')
form#login-form(method='post', action='/log-in')
a(href='#login')
img(src='/images/browser-id-sign-in.png', alt='Browser ID Sign In')
input(type='hidden', name='bid_assertion', value='1')
Expand Down
4 changes: 2 additions & 2 deletions views/templates/elements/auth.jade
@@ -1,10 +1,10 @@
script#auth-element-template(type='text/template')
if sharing
if session.auth && session.auth[projectId]
a(href='/share/#{userId}/project/#{projectId}/screen/#{screenId}/logout')
a(href='/share/#{userId}/project/#{projectId}/screen/#{screenId}/log-out')
img(src='/images/browser-id-sign-out.png', alt='Browser ID Sign Out')
else
form.login-form(method='post', action='/share/#{userId}/project/#{projectId}/screen/#{screenId}/login')
form.login-form(method='post', action='/share/#{userId}/project/#{projectId}/screen/#{screenId}/log-in')
a(href='#login')
img.share-element(src='/images/browser-id-sign-in.png', alt='BrowserID Sign In')
input(type='hidden', name='bid_assertion', value='1')
Expand Down

0 comments on commit c58707a

Please sign in to comment.