Skip to content

Commit

Permalink
Merge pull request #48 from wesley-silv/FMG-29
Browse files Browse the repository at this point in the history
perf(app.js): change the route to before authentication redirect to l…
  • Loading branch information
wesley-silv authored Nov 12, 2024
2 parents 7dffd29 + 31bf685 commit 9aee502
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ app.get('/', requireAuth, (req, res) => {

// Become the route fo login to start the application.
app.get('*', (req, res) => {
res.redirect('/login')
if (!req.session.authenticated) {
res.redirect('/login')
} else {
res.sendFile(path.join(__dirname, 'public', 'index.html'))
}
})

app.listen(port, () => {
Expand Down
4 changes: 2 additions & 2 deletions public/styles/sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
.sidebar {
position: fixed;
top: 0;
right: -20%;
width: 20%;
right: -40%;
width: 40%;
height: 100%;
background-color: #45a049;
opacity: 0.9;
Expand Down

0 comments on commit 9aee502

Please sign in to comment.