SCCapstone / hackstreetboys

https://fridger.recipes
1 stars 0 forks source link

Auth updates #160

Closed jtschuler closed 2 years ago

jtschuler commented 2 years ago

Includes a complete overhaul of the authentication system using JWTs.

To add authorization to an API endpoint, use the @PreAuthorization("hasRole('USER')") or @PreAuthorization("hasRole('ADMIN')") annotation on that endpoint.

Noteworthy changes: The login authentication endpoint has moved from POST /v1/auth/ to POST /v1/auth/login

The registration endpoint has moved from POST /v1/user/ to POST /v1/auth/register

Instead of returning null objects, bad authentication requests now return the proper HTTP status codes.

Please note, this update is backend only and does not update the frontend to be compatible with the changes.