Skip to content
Snippets Groups Projects
Commit f3776173 authored by michael.minelli's avatar michael.minelli
Browse files

Merge branch 'fix-error-message-when-not-logged-in' into v3.2.0

parents 367d0cc3 e56b2a8c
No related branches found
No related tags found
No related merge requests found
Pipeline #27229 passed
openapi: 3.1.0 openapi: 3.1.0
info: info:
title: Dojo API title: Dojo API
version: 3.1.3 version: 3.2.0
description: | description: |
**Backend API of the Dojo project.** **Backend API of the Dojo project.**
......
...@@ -10,7 +10,7 @@ class SecurityMiddleware { ...@@ -10,7 +10,7 @@ class SecurityMiddleware {
check(checkIfConnected: boolean, ...checkTypes: Array<SecurityCheckType>): (req: express.Request, res: express.Response, next: express.NextFunction) => void { check(checkIfConnected: boolean, ...checkTypes: Array<SecurityCheckType>): (req: express.Request, res: express.Response, next: express.NextFunction) => void {
return async (req: express.Request, res: express.Response, next: express.NextFunction) => { return async (req: express.Request, res: express.Response, next: express.NextFunction) => {
if ( checkIfConnected ) { if ( checkIfConnected ) {
if ( req.session.profile === null ) { if ( req.session.profile === null || req.session.profile === undefined ) {
return req.session.sendResponse(res, StatusCodes.UNAUTHORIZED); return req.session.sendResponse(res, StatusCodes.UNAUTHORIZED);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment