gdgpescara / hedwig

Other
20 stars 12 forks source link

BO38 - Create a middleware for authentication and authorization in API #221

Closed gregoriopalama closed 2 months ago

gregoriopalama commented 2 months ago

Create a middleware to check the authentication and the authorization in API. The authentication should just check if the API is being called using a valid Bearer token. The authorization should check if the caller is an organizer (for now, this is the only use case).

Decorate fastify with the middlewares.

Add an utility that will be used to test if the calls are being done with an authenticated user and if the authenticated user is an organizer.