Skip to content

Commit 6fd9b95

Browse files
committed
ci: Minor updates
1 parent 90e332f commit 6fd9b95

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

src/api/controllers/authController.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,6 @@ const handleLogout = (req: Request, res: Response) => {
164164
});
165165
};
166166

167-
/**
168-
* Creates and returns a csrf token.
169-
*
170-
* @param req request from call
171-
* @param res response to call
172-
*
173-
* @returns csrf token
174-
*/
175-
const handleGetCsrfToken = (req: Request, res: Response) => {
176-
return sendSuccessResponse(res, 200, { csrfToken: req.session.csrfToken }, 'CSRF Token Retrieved.');
177-
};
178-
179167
/**
180168
* Handles logging in via github.
181169
*
@@ -208,7 +196,7 @@ const handleGitHubLogin = (req: Request, res: Response) => {
208196
`&state=${state}`;
209197

210198
// return authorize url to frontend
211-
res.json({ authorizationUrl: githubAuthUrl });
199+
sendSuccessResponse(res, 200, { authorizationUrl: githubAuthUrl }, 'Authorization URL Created.');
212200
};
213201

214-
export { handleCallback, handleLoginProcess, handleLogout, handleGetCsrfToken, handleGitHubLogin };
202+
export { handleCallback, handleLoginProcess, handleLogout, handleGitHubLogin };

src/api/routes/authRoutes.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import express from 'express';
22

33
import {
44
handleCallback,
5-
handleGetCsrfToken,
65
handleGitHubLogin,
76
handleLoginProcess,
87
handleLogout,
@@ -19,9 +18,6 @@ router.get('/login/process', handleLoginProcess);
1918
// handles logout
2019
router.get('/logout', handleLogout);
2120

22-
// provides csrf token to frontend
23-
router.get('/csrf-token', handleGetCsrfToken);
24-
2521
// initiates github oauth login flow
2622
router.get('/github/login', handleGitHubLogin);
2723

0 commit comments

Comments
 (0)