Endpoint to get user permissions by a given token #7
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
To protect certain routes in the frontend we need to now the given user permissions only by the current request.
The request only contains the bearer token, so for middleware we need an api endpoint that allows us to fetch user data with the given token.
I suggest implementing
/users/currentthat returns the user for the given Authorization header.