Rails 8.0.1
Ruby 3.3.6
.
I have a new Rails 8 website and I have used the built in authentication generator(rails g authentication
).
I need the user to be able to edit their own password when they are already logged in. But I don’t see any page for this?
The only way for a user to edit their password is to use the “Forgot password” link? I was trying to add an <%= link_to "Edit", edit_password_path(params[:token]) %>
link to my template.
I see there is already a PasswordsController
with edit
and update
actions. But they are only if using password reset link?
So do I have to create a separate/ different controller. A UsersController
with edit
& update
actions? And I need to pass a session token? I just copy/ recreate the Password controller but call it UsersController? Am I not just repeating everything in PasswordsController
?
I see online there are lots of examples of adding user registration, but nothing about letting a user edit their own password.