Skip to content

Commit

Permalink
Merge pull request avoinministerio#277 from naleksi/devise-views
Browse files Browse the repository at this point in the history
Password reseting localization and token lasts 1 day
  • Loading branch information
naleksi committed Nov 14, 2012
2 parents 0123b8f + 3f3b181 commit 2871fe1
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
19 changes: 19 additions & 0 deletions app/views/devise/passwords/edit.fi.html.erb
@@ -0,0 +1,19 @@
<h2>Vaihda salasana</h2>

<%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
<%= f.error_notification %>
<%= f.input :reset_password_token, :as => :hidden %>
<%= f.full_error :reset_password_token %>

<div class="form-inputs">
<%= f.input :password, :label => "Uusi salasana", :required => true %>
<%= f.input :password_confirmation, :label => "Vahvista uusi salasana", :required => true %>
</div>

<div class="form-actions">
<%= f.button :submit, "Vaihda salasana" %>
</div>
<% end %>
<%= render "devise/shared/links" %>
25 changes: 25 additions & 0 deletions app/views/devise/shared/_links.erb
@@ -0,0 +1,25 @@
<%- if controller_name != 'sessions' %>
<%= link_to "Kirjaudu sisään", new_session_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<%= link_to "Rekisteröidy", new_registration_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
<%= link_to "Unohditko salasanasi?", new_password_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
<% end -%>
<% end -%>
3 changes: 2 additions & 1 deletion config/initializers/devise.rb
Expand Up @@ -139,7 +139,8 @@
# Time interval you can reset your password with a reset password key.
# Don't put a too small interval or your users won't have the time to
# change their passwords.
config.reset_password_within = 2.hours
# config.reset_password_within = 2.hours
config.reset_password_within = 1.days

# ==> Configuration for :encryptable
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
Expand Down

0 comments on commit 2871fe1

Please sign in to comment.