Skip to content

Adding middleware-based authorization for Elysia controller endpoints#229

Closed
MahmoudSheemy127 wants to merge 3 commits into
husamql3:v3from
MahmoudSheemy127:v3
Closed

Adding middleware-based authorization for Elysia controller endpoints#229
MahmoudSheemy127 wants to merge 3 commits into
husamql3:v3from
MahmoudSheemy127:v3

Conversation

@MahmoudSheemy127

Copy link
Copy Markdown
Collaborator

In this PR, the authorization is slightly enhanced by introducing middleware-based authorization for the problems and groups controllers defined in Elysia.

Authorization is now handled through a defined common guard

.use(problemsModel)
	.use(isAuthenticated)  //Authorization middleware
	.get("/problems/today", async ({ user }) => {
		return problemsDao.getTodayForUser(user.id)
	})

This acts as a modular approach instead of writing the authorization logic manually inside each controller logic in a repitivie manner.

@husamql3

Copy link
Copy Markdown
Owner

Thanks @MahmoudSheemy127 for your contribution ❤️

As I already explained to you, the scope of this PR and its should be public. I'm assigning you another ticket so you can contribute with us 🚀

@husamql3 husamql3 deleted the branch husamql3:v3 June 30, 2026 19:07
@husamql3 husamql3 closed this Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants