-
Notifications
You must be signed in to change notification settings - Fork 48
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
base: main
Are you sure you want to change the base?
Solution #38
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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), |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
No description provided.