Skip to content

Commit

Permalink
Add logout method
Browse files Browse the repository at this point in the history
  • Loading branch information
mejia-dev committed Mar 29, 2024
1 parent 30b7c10 commit 77d6065
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ app.post('/login', async (req, res) => {
}
});

app.post('/logout', (req, res) => {
res.cookie('token', '', { sameSite: 'none', secure: true }).json('ok');
});

app.post('/register', async (req, res) => {
const { username, password } = req.body;
try {
Expand Down

0 comments on commit 77d6065

Please sign in to comment.