Added logout functionality, helper links and more cookie time

This commit is contained in:
Gabor Javorszky 2013-05-24 07:19:19 +01:00
parent 4becf72228
commit 554a16377b
5 changed files with 7 additions and 2 deletions

2
app.js
View File

@ -30,7 +30,7 @@
ghost.app().use(I18n.load(ghost));
ghost.app().use(express.bodyParser());
ghost.app().use(express.cookieParser('try-ghost'));
ghost.app().use(express.cookieSession({ cookie: { maxAge: 60000 }}));
ghost.app().use(express.cookieSession({ cookie: { maxAge: 60000000 }}));
ghost.app().use(ghost.initTheme(ghost.app()));
ghost.app().use(flash());
// bind locals - options which appear in every view - perhaps this should be admin only

View File

@ -89,6 +89,9 @@
res.redirect('/ghost/login/');
});
} else {
req.flash('error', "The password is too short. Have at least 6 characters in there");
res.redirect('/ghost/register/');
}
},
'logout': function (req, res) {

View File

@ -8,4 +8,5 @@
<input class="password" type="password" placeholder="Password" name="password">
</div>
<button class="button-save" type="submit">Log in</button>
<a href="/ghost/register/">Register</a>
</form>

View File

@ -17,7 +17,7 @@
<li class="usermenu-help"><a href="#">Help / Support</a></li>
<li class="usermenu-shortcuts"><a href="#">Keyboard Shortcuts</a></li>
<li class="divider"></li>
<li class="usermenu-signout"><a href="#">Sign Out</a></li>
<li class="usermenu-signout"><a href="/logout/">Sign Out</a></li>
</ul>
</li>
</ul>

View File

@ -8,4 +8,5 @@
<input class="password" type="password" placeholder="Password" name="password">
</div>
<button class="button-save" type="submit">Register</button>
<a href="/ghost/login/">Log in</a>
</form>