0

I have generated normal reset password portlet for non-admin users and inserted it to the page, but it seems not to be working. It just does nothing while submitted.

The code of portlet is the standard:

<% if flash_scope = flash[:reset_password] -%>
  <% if flash_scope[:error] -%>
    <span class="reset-password-error"><%= flash_scope[:error] %></span>
  <% end -%>
  <% if flash_scope[:notice] -%>
    <span class="reset-password-notice"><%= flash_scope[:notice] %></span>
  <% end -%>
<% end -%>

<%= form_tag '' do %>
  <% if params[:token] -%>
  <%= hidden_field_tag "token", params[:token] %>
  <% end -%>

  <label for="password">New Password:</label>
  <%= password_field_tag "password" %><br>

  <label for="password_confirmation">Confirm New Password:</label>
  <%= password_field_tag "password_confirmation" %><br>

  <%= submit_tag "Reset Password" %>
<% end %>

Am I missing something?

Roope Hakulinen
  • 7,326
  • 4
  • 43
  • 66
  • Would you be kind enough to expand on "not working"? What does params[] contain when this page return to your controller? – thisfeller Mar 22 '13 at 13:42

1 Answers1

0

Thank you thisfeller for push to the right direction!

The problem was that the default password change portlet is mentioned to be used only with password reset portlet that sends email to user etc. So I wrote my own portlet based on that reset password portlet but removed the finding of wanted user by token and instead just check who is logged in.

Roope Hakulinen
  • 7,326
  • 4
  • 43
  • 66