acikyazilimagi / acikyazilimagi/afetlojistik-backend

Create custom 'Request' type

Aperta
#174 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
11
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Şu an için controller class'larında '@Req() req' için tanımlanan bir type yok. 'any' olarak dönüş yapıyor. Nestjs'in şu an için 'express' üzerinde çalışıyor ve request, response değerleri buradan geliyor. Authentication olunması beklenmeyen (exp: Guard'lı olmayanlar) route'larda express'in Request type'ını, authentication olunması beklenen (exp: Guard'lı olanlar) route'larda custom bir Request type kullanabiliriz. Bu custom Request için şuan gördüğüm 'user' property'sidir. Bu user için de JWT payload'ından gelen verileri kullanabiliriz.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.