Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Commit

Permalink
🎨 Send an error if not logged in (GET /api/session/user)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gum-Joe committed Jun 23, 2016
1 parent 980cce9 commit 4a478a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/routes/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const app = express();

// GET /session/user
app.get('/session/user', (req, res) => {
res.json(req.user);
res.json(req.user || { error: "You don't appear to be logged in." });
});

// Export
Expand Down

0 comments on commit 4a478a8

Please sign in to comment.