Skip to content
This repository has been archived by the owner on Jul 15, 2020. It is now read-only.

Commit

Permalink
cleanup login
Browse files Browse the repository at this point in the history
  • Loading branch information
kbingman committed May 21, 2012
1 parent 2b78ba3 commit 7bdef42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ ss.client.define('login', {
tmpl: '*'
});


// Serve this client on the admin URL
// This is the only url that is not protected
ss.http.route('/login', function(req, res){
res.serveClient('login');
if(req.session.userId){
res.writeHead(302, { 'Location': '/' });
res.end();
} else {
res.serveClient('login');
}
});

// Serve this client on the admin URL
Expand All @@ -44,7 +48,6 @@ ss.http.route('/', function(req, res){
}
});


// Serve this client on the admin URL
ss.http.route('/admin', function(req, res){
if(req.session.userId){
Expand Down
2 changes: 1 addition & 1 deletion client/templates/login/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h3>Login</h3>
<div class="control-group">
<label class="control-label" for="player-password">Password</label>
<div class="controls">
<input type="text" class="input large" name="name" id="player-password" value="">
<input type="password" class="input large" name="name" id="player-password" value="">
<span class="help-inline">{{ helpText }}</span>
</div>
</div>
Expand Down

0 comments on commit 7bdef42

Please sign in to comment.