Skip to content

[Feature] Custom @login_required Decorator #12

@karastoyanov

Description

@karastoyanov

✨ Feature Description

Create a reusable @login_required decorator to protect authenticated routes.

🧩 Problem Statement

Sensitive endpoints must not be accessible to unauthenticated users. Repeating auth logic in every route leads to duplication and errors.

💡 Proposed Solution

Implement a custom decorator that:
• Validates authentication (JWT or session)
• Attaches user context to the request
• Rejects unauthorized access with proper HTTP status codes

🔄 Alternatives Considered

📋 Acceptance Criteria

•	@login_required decorator exists
•	Unauthorized requests return 401
•	Authenticated user context is accessible in routes
•	Decorator is reusable across services

🔗 Related Issues / Links

📎 Additional Context

Metadata

Metadata

Labels

featureNew functionality or behavior

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions