Skip to content

Commit 3bd1f18

Browse files
committed
refactor: remove unnecessary comments from session controller files
1 parent 6361ea0 commit 3bd1f18

2 files changed

Lines changed: 0 additions & 19 deletions

File tree

server/controllers/__tests__/session.controller.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ describe('session.controller', () => {
2828
response = new MockResponse();
2929
next = jest.fn();
3030

31-
// Add missing properties that jest-express MockRequest doesn't have by default but Passport uses
3231
(request as any).logIn = jest.fn();
3332
(request as any).logout = jest.fn();
3433
(request as any).session = {

server/controllers/session.controller.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ import { RequestHandler } from 'express';
44

55
import { userResponse } from './user.controller';
66

7-
/**
8-
* - Id: `SessionController.createSession`
9-
*
10-
* Description:
11-
* - Creates a new user session (Login) using Passport's local strategy.
12-
*/
137
export const createSession: RequestHandler = (req, res, next) => {
148
passport.authenticate('local', (err: Error, user: Express.User) => {
159
if (err) {
@@ -31,12 +25,6 @@ export const createSession: RequestHandler = (req, res, next) => {
3125
})(req, res, next);
3226
};
3327

34-
/**
35-
* - Id: `SessionController.getSession`
36-
*
37-
* Description:
38-
* - Retrieves the current session user. Returns null if not authenticated.
39-
*/
4028
export const getSession: RequestHandler = (req, res) => {
4129
if (!req.user) {
4230
return res.status(200).send({ user: null });
@@ -48,12 +36,6 @@ export const getSession: RequestHandler = (req, res) => {
4836
return res.json(userResponse(req.user));
4937
};
5038

51-
/**
52-
* - Id: `SessionController.destroySession`
53-
*
54-
* Description:
55-
* - Destroys the current session (Logout).
56-
*/
5739
export const destroySession: RequestHandler = (req, res, next) => {
5840
req.logout((err: Error) => {
5941
if (err) {

0 commit comments

Comments
 (0)