Rewrite authorization as middleware #7

Open
opened 2024-11-07 12:38:23 +05:00 by lumin · 0 comments
Owner

I thought this was too complicated at first.

The first middleware should try to authenticate the user using the access token in the cookie. Request handlers should have a way to get the current user.

The second middleware is only for admin pages, it should abort the request if the user is not an admin.

I thought this was too complicated at first. The first middleware should try to authenticate the user using the access token in the cookie. Request handlers should have a way to get the current user. The second middleware is only for admin pages, it should abort the request if the user is not an admin.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lumin/comfycamp#7
No description provided.