Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
Merge pull request #239 from nono/fixes
Browse files Browse the repository at this point in the history
Fix for #154 and #199
  • Loading branch information
Frank Rousseau committed Feb 5, 2016
2 parents 28872b3 + c81b03a commit 1e26911
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
4 changes: 2 additions & 2 deletions server/controllers/routes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ module.exports =
'routes/reset*': get: index.resetRoutes

'register':
get: auth.registerIndex
get: [utils.isNotAuthenticated, auth.registerIndex]
post: [auth.register, utils.authenticate]

'login':
get: auth.loginIndex
get: [utils.isNotAuthenticated, auth.loginIndex]
post: utils.authenticate
'login/forgot': post: auth.forgotPassword
'logout': get: [utils.isAuthenticated, auth.logout]
Expand Down
4 changes: 4 additions & 0 deletions server/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"index title": "Cozy - Your Private Personal Cloud",
"index description": "Cozy is an app-based personal cloud you can host at home. It allows you to own and connect your data. It turns a low-cost piece of hardware like a Raspberry Pi 2 or an online VPS into a powerful app platform. It comes with common applications like a contacts manager, calendar, webmail and filebox.",
"index noscript title": "Sorry",
"index noscript message": "Cozy needs JavaScript and cookies to work but it looks like you have disabled one of them.",
"error title": "Oops, an error has occurred",
"error headline": "It seems that something went wrong.",
"error reinsurance": "Don't worry, it's probably not that bad!",
Expand Down
6 changes: 5 additions & 1 deletion server/middlewares/authentication.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ module.exports.isAuthenticated = (req, res, next) ->
url += "&#{qs.stringify req.query}" if req.query.length
res.redirect url


module.exports.isNotAuthenticated = (req, res, next) ->
if req.isAuthenticated()
res.redirect '/'
else
next()
11 changes: 9 additions & 2 deletions server/views/index.jade
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
extends layouts/_base

block title
title Cozy - Your Private Personal Cloud
meta(name="description", content="Cozy is an app-based personal cloud you can host at home. It allows you to own and connect your data. It turns a low-cost piece of hardware like a Raspberry Pi 2 or an online VPS into a powerful app platform. It comes with common applications like a contacts manager, calendar, webmail and filebox.")
title= t('index title')
meta(name="description", content=t('index description'))


block content
main(role='application')
noscript
section.popup
header
a(title='Cozy Website', href='https://cozy.io')
.container
h1= t('index noscript title')
p.help= t('index noscript message')

block js
script(src="/scripts/vendor.js")
Expand Down

0 comments on commit 1e26911

Please sign in to comment.