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

Prepare for v4.1.0

parent 41fb3f8d
No related branches found
No related tags found
No related merge requests found
Pipeline #32008 failed
...@@ -18,7 +18,16 @@ ...@@ -18,7 +18,16 @@
--> -->
## 4.0.0 (???) ## 4.1.0 (Upcoming)
### ✨ Feature
- Add features related to corrige (commentary, commit specific link / update, delete link)
### 🎨 Interface
- Ask for confirmation before creating an exercise that already exists
## 4.0.0 (2024-04-19)
### ✨ Feature ### ✨ Feature
- Add features related to corrige (commentary, commit specific link / update, delete link) - Add features related to corrige (commentary, commit specific link / update, delete link)
......
{ {
"name": "dojo_backend_api", "name": "dojo_backend_api",
"version": "4.0.0", "version": "4.1.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "dojo_backend_api", "name": "dojo_backend_api",
"version": "4.0.0", "version": "4.1.0",
"license": "AGPLv3", "license": "AGPLv3",
"dependencies": { "dependencies": {
"@dotenvx/dotenvx": "^0.27.1", "@dotenvx/dotenvx": "^0.27.1",
......
{ {
"name" : "dojo_backend_api", "name" : "dojo_backend_api",
"description" : "Backend API of the Dojo project", "description" : "Backend API of the Dojo project",
"version" : "4.0.0", "version" : "4.1.0",
"license" : "AGPLv3", "license" : "AGPLv3",
"author" : "Michaël Minelli <dojo@minelli.me>", "author" : "Michaël Minelli <dojo@minelli.me>",
"main" : "dist/src/app.js", "main" : "dist/src/app.js",
......
...@@ -6,8 +6,8 @@ import AssignmentManager from '../managers/AssignmentManager.js'; ...@@ -6,8 +6,8 @@ import AssignmentManager from '../managers/AssignmentManager.js';
class SecurityMiddleware { class SecurityMiddleware {
private isConnected(checkIfConnected: boolean, req: express.Request): boolean { private checkIfConnected(checkIfConnected: boolean, req: express.Request): boolean {
return checkIfConnected && req.session.profile !== null && req.session.profile !== undefined; return !checkIfConnected || (req.session.profile !== null && req.session.profile !== undefined);
} }
private async checkType(checkType: SecurityCheckType, req: express.Request): Promise<boolean> { private async checkType(checkType: SecurityCheckType, req: express.Request): Promise<boolean> {
...@@ -34,6 +34,7 @@ class SecurityMiddleware { ...@@ -34,6 +34,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 (req: express.Request, res: express.Response, next: express.NextFunction) => { return (req: express.Request, res: express.Response, next: express.NextFunction) => {
if ( !this.isConnected(checkIfConnected, req) ) { if ( !this.isConnected(checkIfConnected, req) ) {
if ( !this.checkIfConnected(checkIfConnected, req) ) {
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