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

Fix option to only allow users to edit their profile within first 24 hours #36

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

petecheslock
Copy link
Contributor

This pull request introduces a change to the correct_user method in the UsersController to limit the time frame in which a user can edit their profile to the first 24 hours after account creation.

Changes include:

Added a condition in correct_user method to check if the current time is more than 24 hours from the time of account creation.
If the condition is met, a flash message is displayed informing the user that they can only edit their profile within 24 hours of account creation, and they are redirected to the root URL.
This change is intended to enhance account security by reducing the window in which a user's profile can be edited. It will be particularly effective in limiting the potential damage if a user's account is compromised.

Please review and provide any feedback.

Copy link

github-actions bot commented Dec 22, 2023

AppMap runtime code review

Summary Status
Failed tests ✅ All tests passed
API changes 0️⃣ No API changes
Security flaws ✅ None detected
Performance problems ✅ None detected
Code anti-patterns ✅ None detected
New AppMaps ⭐ 2 new minitest tests

⭐ New AppMaps

[minitest] Users controller should allow the user to edit profile within 24 hours of account creation from test/controllers/users_controller_test.rb:50

[minitest] Users controller should not allow the user to edit profile after 24 hours of account creation from test/controllers/users_controller_test.rb:41

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.

1 participant