forked from berserker/microblog
pam authentication (#5303)
* add pam support, without extra column * bugfixes for pam login * document options * fix code style * fix codestyle * fix tests * don't call remember_me without password * fix codestyle * improve checks for pam usage (should fix tests) * fix remember_me part 1 * add remember_token column because :rememberable requires either a password or this column. * migrate db for remember_token * move pam_authentication to the right place, fix logic bug in edit.html.haml * fix tests * fix pam authentication, improve username lookup, add comment * valid? is sometimes not honored, return nil instead trying to authenticate with pam * update devise_pam_authenticatable2 and adjust code. Fixes sideeffects observed in tests * update devise_pam_authenticatable gem, fixes for codeconventions, fix finding user * codeconvention fixes * code convention fixes * fix idention * update dependency, explicit conflict check * fix disabled password updates if in pam mode * fix check password if password is present, fix templates * block registration if account is maintained by pam * Revert "block registration if account is maintained by pam" This reverts commit 8e7a083d650240b6fac414926744b4b90b435f20. * fix identation error introduced by rebase * block usernames maintained by pam * document pam settings better * fix code stylelocal
parent
1afc70c990
commit
04fef7b888
15 changed files with 164 additions and 17 deletions
@ -1,14 +1,18 @@ |
|||||||
- content_for :page_title do |
- content_for :page_title do |
||||||
= t('auth.set_new_password') |
= t('auth.set_new_password') |
||||||
|
|
||||||
= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| |
= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| |
||||||
= render 'shared/error_messages', object: resource |
= render 'shared/error_messages', object: resource |
||||||
= f.input :reset_password_token, as: :hidden |
|
||||||
|
|
||||||
= f.input :password, autofocus: true, placeholder: t('simple_form.labels.defaults.new_password'), input_html: { 'aria-label' => t('simple_form.labels.defaults.new_password'), :autocomplete => 'off' } |
- if use_pam? || current_user.encrypted_password.present? |
||||||
= f.input :password_confirmation, placeholder: t('simple_form.labels.defaults.confirm_new_password'), input_html: { 'aria-label' => t('simple_form.labels.defaults.confirm_new_password'), :autocomplete => 'off' } |
= f.input :reset_password_token, as: :hidden |
||||||
|
|
||||||
.actions |
= f.input :password, autofocus: true, placeholder: t('simple_form.labels.defaults.new_password'), input_html: { 'aria-label' => t('simple_form.labels.defaults.new_password'), :autocomplete => 'off' } |
||||||
= f.button :button, t('auth.set_new_password'), type: :submit |
= f.input :password_confirmation, placeholder: t('simple_form.labels.defaults.confirm_new_password'), input_html: { 'aria-label' => t('simple_form.labels.defaults.confirm_new_password'), :autocomplete => 'off' } |
||||||
|
|
||||||
|
.actions |
||||||
|
= f.button :button, t('auth.set_new_password'), type: :submit |
||||||
|
- else |
||||||
|
= t('simple_form.labels.defaults.pam_account') |
||||||
|
|
||||||
.form-footer= render 'auth/shared/links' |
.form-footer= render 'auth/shared/links' |
||||||
|
@ -0,0 +1,5 @@ |
|||||||
|
class AddRememberTokenToUsers < ActiveRecord::Migration[5.1] |
||||||
|
def change |
||||||
|
add_column :users, :remember_token, :string, null: true |
||||||
|
end |
||||||
|
end |
Loading…
Reference in new issue