Commit 3e7342ab authored by Vytor Calixto's avatar Vytor Calixto 👾
Browse files

Adicionada view para conta

parent 3f704a60
<!DOCTYPE html>
<html>
<% include partials/head %>
<body>
<% include partials/basic-header %>
<section class="card margin clearfix">
<h2><%= user.nome %> - @<%= user.username %></h2>
<h4><% if (user.verificado) { %>
Conta verificada
<% } else { %>
Conta não verificada
<% } %>
</h4>
<% if (user.admin || user.moderador) { %>
<p>
<% if(user.admin) { %>
<span>Administrador</span>
<% } else if(user.moderador) { %>
<span>Moderador</span>
<% } %>
</p>
<% } %>
<p>Membro desde <%= user.criado %></p>
</section>
<% include partials/footer %>
</body>
</html>
......@@ -13,6 +13,8 @@
<span>|</span>
<a href="/admin">Admin</a>
<% } %>
<span>|</span>
<a href="/logout">Sair</a>
<% } %>
</div>
<section class="index">
......
<html>
<% include partials/head %>
<% include partials/basic-header %>
<body>
<% include partials/basic-header %>
<% if (message.length > 0) { %>
<div class="card margin"><%= message %></div>
<% } %>
......
<html>
<% include partials/head %>
<% include partials/basic-header %>
<body>
<% include partials/basic-header %>
<% if (message.length > 0) { %>
<div class="card margin"><%= message %></div>
<% } %>
......
......@@ -39,6 +39,7 @@ module.exports = {
return next()
}
req.flash('loginMessage', 'Você precisa estar logado para acessar essa página')
res.redirect('/login')
}
}
......
......@@ -25,6 +25,11 @@ router.post('/login', passport.authenticate('local-login', {
failureFlash: true
}))
router.get('/logout', function(req, res) {
req.logout()
res.redirect('/')
})
router.get('/signup', function(req, res) {
res.render('signup', {message: req.flash('signupMessage')})
})
......@@ -35,4 +40,9 @@ router.post('/signup', passport.authenticate('local-signup', {
failureFlash: true
}))
router.get('/conta', role.isLoggedIn(), function(req, res) {
res.render('conta', {user: req.user})
})
module.exports = router
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment