-
Notifications
You must be signed in to change notification settings - Fork 1
Add user and auth apis #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add user and auth apis #118
Conversation
🦋 Changeset detectedLatest commit: ba8c44e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #118 +/- ##
==========================================
+ Coverage 45.53% 46.27% +0.73%
==========================================
Files 36 47 +11
Lines 437 577 +140
Branches 14 27 +13
==========================================
+ Hits 199 267 +68
- Misses 236 304 +68
- Partials 2 6 +4 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for preparing this PR.
I've refactored a few things:
- Move migrations to
db/migrations
similar to Rails. - Add seeders in
db/seeds
similar to Rails - Replace Passportjs with cookie based sessions.
- The documentation of Passportjs is very bad and hard to unterstand.
- Having JWTs is maybe not right (https://redis.io/blog/json-web-tokens-jwt-are-dangerous-for-user-sessions/)
- Session based authentication is easier to implement as on the client side the browser is dealing with everything.
- Replace express with fastify.
- The session implementation of express isn't that good and doesn't offer stateless cookies. Using express session would require for another data storage like redis.
- https://github.com/fastify/fastify-secure-session offers stateless cookies based on SKBE.
- Fastify is supposed to be more performant.
Still work in progress.. haven't tested it yet.