Ajout Login et Register #6

Merged
clement.freville2 merged 10 commits from login-register into main 10 months ago
Owner
There is no content yet.
clement.freville2 was assigned by hugo.pradier2 10 months ago
hugo.pradier2 added 6 commits 10 months ago
continuous-integration/drone/push Build is passing Details
1fd6463caf
verif si login pas deja present avant ajout user
continuous-integration/drone/push Build is passing Details
04f9fd9c04
début hashage
continuous-integration/drone/push Build is failing Details
de4a7d000f
add hash
continuous-integration/drone/push Build is failing Details
f2ed1a86b9
debut jwt auth
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details
87190e9362
ajout de jwt fonctionnel
hugo.pradier2 requested review from clement.freville2 10 months ago
clement.freville2 requested changes 10 months ago
package.json Outdated
"fmt": "dprint fmt"
},
"devDependencies": {
"@types/bcryptjs": "^2.4.6",
-    "@types/bcryptjs": "^2.4.6",
+    "@types/bcrypt": "^5.0.2",
```diff - "@types/bcryptjs": "^2.4.6", + "@types/bcrypt": "^5.0.2", ```
clement.freville2 marked this conversation as resolved
package.json Outdated
"bcrypt": "^5.1.1",
"bcryptjs": "^2.4.3",
"fastify": "^4.27.0",
"fastify-jwt": "^4.2.0",
-    "@fastify/jwt": "^5.0.1",
     "@fastify/type-provider-typebox": "^4.0.0",
     "@fastify/websocket": "^10.0.1",
     "@sinclair/typebox": "^0.32.9",
-    "@types/bcrypt": "^5.0.2",
     "bcrypt": "^5.1.1",
-    "bcryptjs": "^2.4.3",
     "fastify": "^4.27.0",
-    "fastify-jwt": "^4.2.0"
```diff - "@fastify/jwt": "^5.0.1", "@fastify/type-provider-typebox": "^4.0.0", "@fastify/websocket": "^10.0.1", "@sinclair/typebox": "^0.32.9", - "@types/bcrypt": "^5.0.2", "bcrypt": "^5.1.1", - "bcryptjs": "^2.4.3", "fastify": "^4.27.0", - "fastify-jwt": "^4.2.0" ```
clement.freville2 marked this conversation as resolved
src/server.ts Outdated
reply.send({ success: false });
} else {
reply.send({ success: true });
}
-    if (!(await db.insertUser(database, login, hashedPassword, permissions))) {
-      reply.send({ success: false });
-    } else {
-      reply.send({ success: true });
-    }
+    const success = await db.insertUser(database, login, hashedPassword, permissions);
+    reply.send({ success });
```diff - if (!(await db.insertUser(database, login, hashedPassword, permissions))) { - reply.send({ success: false }); - } else { - reply.send({ success: true }); - } + const success = await db.insertUser(database, login, hashedPassword, permissions); + reply.send({ success }); ```
clement.freville2 marked this conversation as resolved
src/server.ts Outdated
}
);
/* Route pour vérifier si un utilisateur existe */

This route should login the user, not just verify its username and password. It should create a session or a JWT token for them to operate.

This route should login the user, not just verify its username and password. It should create a session or a JWT token for them to operate.
clement.freville2 marked this conversation as resolved
hugo.pradier2 added 1 commit 10 months ago
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
07278e25e1
correctifs
hugo.pradier2 requested review from clement.freville2 10 months ago
hugo.pradier2 added 2 commits 10 months ago
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is failing Details
7e9aeee401
debut session
clement.freville2 added 1 commit 10 months ago
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details
a7af94e6d3
Remove the cookie secure flag
clement.freville2 force-pushed login-register from a7af94e6d3 to 15e29bdb56 10 months ago
clement.freville2 added 1 commit 10 months ago
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
d9c613f523
Merge branch 'main' into login-register
clement.freville2 merged commit 3c79473164 into main 10 months ago
clement.freville2 deleted branch login-register 10 months ago

Reviewers

clement.freville2 was requested for review 10 months ago
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
The pull request has been merged as 3c79473164.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: sandkasten/labyrinth#6
Loading…
There is no content yet.