Commit 33f4f161 authored by Mayra Cabrera's avatar Mayra Cabrera 🌴

Merge branch...

Merge branch 'security-users-can-update-their-password-without-entering-current-password' into 'master'

[Master] No longer allow password change without previous password being provided

See merge request gitlab/gitlabhq!2383
parents 046cc601 8417f74f
......@@ -93,8 +93,6 @@ class ProfilesController < Profiles::ApplicationController
title: Prevent user passwords from being changed without providing the previous password
type: security
......@@ -3,6 +3,19 @@ require('spec_helper')
describe ProfilesController, :request_store do
let(:user) { create(:user) }
describe 'POST update' do
it 'does not update password' do
expect do
post :update,
user: { password: 'hello12345', password_confirmation: 'hello12345' }
end.not_to change { user.reload.encrypted_password }
expect(response.status).to eq(302)
describe 'PUT update' do
it 'allows an email update from a user without an external email address' do
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment