code4romania / de-urgenta-backend

De Urgență backend - web & mobile
https://de-urgenta-backend.vercel.app/
Mozilla Public License 2.0
10 stars 21 forks source link

Extract base auth controller #178

Closed idormenco closed 1 year ago

idormenco commented 1 year ago

In our controllers decorated with Authorize we extract user sub via var sub = User.Claims.FirstOrDefault(c => c.Type == "sub")?.Value; Extract a base controller that will provide this value using a property. Do not throw exception if sub is not present.