diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9f74f4f..3ca3c01 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -74,7 +74,9 @@ def user_params # Confirms the correct user. def correct_user @user = User.find(params[:id]) - redirect_to(root_url, status: :see_other) unless current_user?(@user) + if Time.now - @user.created_at > 24.hours + flash[:danger] = "You can only edit your profile within 24 hours of account creation." + end end # Confirms an admin user.