Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #38

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Solution #38

wants to merge 1 commit into from

Conversation

jyjuk
Copy link

@jyjuk jyjuk commented Feb 11, 2025

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Great job on implementing the core functionalities and meeting the task requirements! 🎉 While there are a few minor issues, such as unused imports and hardcoded token values, they don't significantly impact the overall functionality. Consider addressing these in future updates to enhance code quality. Keep up the good work! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

status_code=status.HTTP_409_CONFLICT,
detail=f"A user with this email {user_data.email} already exist."
)
hashed_password = hash_password(user_data.password)

Choose a reason for hiding this comment

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

The function hash_password is used here, but it is not imported or defined within this file. Ensure that hash_password is properly imported from the correct module.

db.refresh(new_user)

activation_token = ActivationTokenModel(
token="some_generated_token",

Choose a reason for hiding this comment

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

The token value 'some_generated_token' is hardcoded. Consider using a secure method to generate unique tokens for each user.

db.query(PasswordResetTokenModel).filter(PasswordResetTokenModel.user_id == user.id).delete()

reset_token = PasswordResetTokenModel(
token="some_generated_token",

Choose a reason for hiding this comment

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

The token value 'some_generated_token' is hardcoded. Consider using a secure method to generate unique tokens for each password reset request.


new_refresh_token = RefreshTokenModel(
token=refresh_token,
expires_at=datetime.now(timezone.utc) + timedelta(days=get_settings().LOGIN_TIME_DAYS),

Choose a reason for hiding this comment

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

Ensure that get_settings().LOGIN_TIME_DAYS returns a valid integer value for the token expiration calculation. If this value is not set correctly, it could lead to incorrect expiration times.

@@ -1,5 +1,58 @@
from pydantic import BaseModel, EmailStr, field_validator
from pydantic import BaseModel, EmailStr, field_validator, constr

Choose a reason for hiding this comment

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

The import field_validator is not used in this file. Consider removing it to clean up the code.

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