Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,22 @@ def create_openid_token_for(app, issuer = "login.instedd.org")
JWT.encode payload, app.secret, 'HS512'
end

# update code from devise 3.4.0 to avoid checking current_password
def update_with_password(params, *options)
if params[:password].blank?
params.delete(:password)
params.delete(:password_confirmation) if params[:password_confirmation].blank?
end

result = update_attributes(params, *options)

clean_up_passwords
result
end

private

def touch_lifespan
Telemetry::Lifespan.touch_user(self)
end

end
4 changes: 0 additions & 4 deletions app/views/devise/registrations/edit.haml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
= f.input_field :password_confirmation, placeholder: 'Password confirmation', class: "block password"
= f.full_error :password_confirmation

= f.input :current_password, :label => false, :hint => raw("<i>we need your current password to confirm your changes</i>"), :error => false do
= f.input_field :current_password, placeholder: 'Current password', class: "block password"
= f.full_error :current_password

.control-group
.controls
= f.submit "Update", class: 'btn'
Expand Down