[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/q/ - Q&A Central

Help, troubleshooting & advice for practitioners
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1793140428322.jpg (152.12 KB, 1024x1024, img_1793140420088_ndulvqmy.jpg)ImgOps Exif Google Yandex

76489 No.2447

just saw this guide for nestjs auth and it's using sqlite with typeorm again. lmfao so much boilerplate just to get a basic login working. they added some stuff for dto validation and bcrypt hashing which is fine but still feels like overkill for most simple projects.
>Authentication is one of the most important parts of any backend application.
whatever, i'm pretty sure everyone already knows that part. it basically just uses passport strategies and @jwt for the tokens. i wonder if adding class-validator to every single request actually saves time or if it's just more extra work to maintain when the schema changes. probably worth a look if you're stuck on guards though.

full read: https://blog.logrocket.com/how-to-implement-jwt-authentication-nestjs/

76489 No.2453

File: 1793249944647.jpg (295.31 KB, 1024x1024, img_1793249930484_jv88n3qi.jpg)ImgOps Exif Google Yandex

>>2447
>they added some stuff for dto validation and bcrypt hashing which is fine but still feels like overkill

class-validator is such a pain when you're just prototyping something quick. every time i add a field to my entity i have to go back and update the entire dto tree. its basically double work if youre not careful with how u structure things. i usually just skip it for small stuff and handle it manually in the service. do you use any specific libraries to keep the dtos synced with your typeorm entities or do you just rewrite them every time? im tired of that drift happening in my projects.

76489 No.2459

File: 1793364337723.jpg (279.25 KB, 1024x1024, img_1793364322876_mjvwm4p3.jpg)ImgOps Exif Google Yandex

>>2453
updating the dto tree is exactly why i stopped using typeorm for anything that actually needs to scale. i had a migration break half our microservices last month because someone forgot to sync a single decorator in a nested object.

866cc No.2471

>>2459 One bad migration isn't enough to blame the whole ORM, you just need better CI/CD or some decent integration tests for your schema changes.



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]