Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • add_route_assignments
  • ask-user-to-delete-exercises-on-duplicates
  • bedran_exercise-list
  • jw_sonar
  • jw_sonar_backup
  • main
  • update-dependencies
  • v6.0.0
  • 2.0.0
  • 2.1.0
  • 2.2.0
  • 3.0.0
  • 3.0.1
  • 3.1.0
  • 3.1.1
  • 3.1.2
  • 3.1.3
  • 3.2.0
  • 3.3.0
  • 3.4.0
  • 3.4.1
  • 3.4.2
  • 3.5.0
  • 3.5.1
  • 3.5.2
  • 3.5.3
  • 4.0.0
  • 4.1.0
  • 5.0.0
  • 5.0.1
  • 6.0.0-dev
  • v1.0.1
32 results

Target

Select target project
  • Dojo_Project_Nguyen/backend/dojobackendapi
  • dojo_project/projects/backend/dojobackendapi
2 results
Select Git revision
  • add_route_assignments
  • ask-user-to-delete-exercises-on-duplicates
  • bedran_exercise-list
  • jw_sonar
  • jw_sonar_backup
  • main
  • update-dependencies
  • v6.0.0
  • 2.0.0
  • 2.1.0
  • 2.2.0
  • 3.0.0
  • 3.0.1
  • 3.1.0
  • 3.1.1
  • 3.1.2
  • 3.1.3
  • 3.2.0
  • 3.3.0
  • 3.4.0
  • 3.4.1
  • 3.4.2
  • 3.5.0
  • 3.5.1
  • 3.5.2
  • 3.5.3
  • 4.0.0
  • 4.1.0
  • 5.0.0
  • 5.0.1
  • 6.0.0-dev
  • v1.0.1
32 results
Show changes
Commits on Source (1)
...@@ -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> {
...@@ -33,7 +33,7 @@ class SecurityMiddleware { ...@@ -33,7 +33,7 @@ class SecurityMiddleware {
// First check if connected then check if at least ONE rule match. It's NOT an AND but it's a OR function. // First check if connected then check if at least ONE rule match. It's NOT an AND but it's a OR function.
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.checkIfConnected(checkIfConnected, req) ) {
return req.session.sendResponse(res, StatusCodes.UNAUTHORIZED); return req.session.sendResponse(res, StatusCodes.UNAUTHORIZED);
} }
......