Skip to content

Commit 50d65ca

Browse files
committed
fixes for api
1 parent f84bc66 commit 50d65ca

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

api/server.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const DOTENV_CONFIG_PATH = process.env.DOTENV_CONFIG_PATH;
1616
const MemoryStore = MemoryStoreFactory(session);
1717
const limiter = RateLimit({
1818
windowMs: 15 * 60 * 1000, // 15 minutes
19-
max: 100, // max 100 requests per windowMs
19+
max: 1000, // max 1000 requests per windowMs
2020
skip: (req) => {
2121
// Skip rate limiting for localhost
2222
return isLocalhost(req);
@@ -160,6 +160,12 @@ app.get('/login', (req, res) => {
160160
res.redirect(`https://github.com/login/oauth/authorize?client_id=${process.env.GITHUB_CLIENT_ID}&redirect_uri=${redirectUrl}&state=${req.session.state}`);
161161
});
162162

163+
app.get('/logout', (req, res) => {
164+
// destroy the session
165+
req.session.destroy();
166+
res.redirect('/');
167+
});
168+
163169
app.get('/callback', async (req, res) => {
164170
const code = req.query.code;
165171
const state = req.query.state;

0 commit comments

Comments
 (0)