Skip to content

Conversation

@Big-Lolo
Copy link
Member

No description provided.

@Big-Lolo Big-Lolo requested a review from Copilot October 21, 2025 18:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the user registration flow by adding authentication requirements and changing the default activation status. The signup endpoint is uncommented and now requires authentication, while new users are created in an inactive state by default.

Key changes:

  • New users are now created with active = False instead of active = True
  • The /signup endpoint now requires authentication via JWT token with LLEIDAHACKER user type
  • Email notification system for new user creation is re-enabled

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/impl/LleidaHacker/service.py Changed default user activation status to inactive with warning comment
src/impl/LleidaHacker/router_v1.py Uncommented and modified signup endpoint to require authentication and send verification emails

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +28 to +31
def signup(payload: LleidaHackerCreate, token: BaseToken = Depends(JWTBearer())):
if not token.check([UserType.LLEIDAHACKER]):
raise AuthenticationException("Not authorized")

Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The signup endpoint should not require authentication. Requiring a JWT token to create a new user account creates a chicken-and-egg problem where users cannot sign up without already being authenticated. This breaks the typical user registration flow.

Suggested change
def signup(payload: LleidaHackerCreate, token: BaseToken = Depends(JWTBearer())):
if not token.check([UserType.LLEIDAHACKER]):
raise AuthenticationException("Not authorized")
def signup(payload: LleidaHackerCreate):

Copilot uses AI. Check for mistakes.
)
new_lleidahacker.password = get_password_hash(payload.password)
new_lleidahacker.active = True
new_lleidahacker.active = False # IMPORTANT DO NOT ACTIVATE USER AUTOMATICALLY !!!!!!!!!!!!! @Big_Lolo
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The comment uses excessive punctuation and mentions a specific person. Comments should be professional and explain the reasoning rather than using emphatic styling. Consider: '# Users must be manually activated by administrators for security reasons' or reference a configuration setting/documentation.

Suggested change
new_lleidahacker.active = False # IMPORTANT DO NOT ACTIVATE USER AUTOMATICALLY !!!!!!!!!!!!! @Big_Lolo
new_lleidahacker.active = False # Users must be manually activated by administrators for security reasons

Copilot uses AI. Check for mistakes.
@Big-Lolo Big-Lolo merged commit c687445 into main Oct 21, 2025
5 of 7 checks passed
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