diff --git a/client/actions/user.js b/client/actions/user.js index 2d4e8cbea..5ac9b2267 100644 --- a/client/actions/user.js +++ b/client/actions/user.js @@ -422,13 +422,11 @@ export function cancelPasswordReset() { export function resetPassword(application) { return (dispatch, getState) => { const { user: { user_id }, connection } = getState().passwordReset.toJS(); - const clientId = application.client.value || application.client; dispatch({ type: constants.PASSWORD_RESET, payload: { promise: axios.post(`/api/users/${user_id}/password-reset`, { - connection, - clientId + connection }) }, meta: { diff --git a/client/containers/Users/Dialogs/PasswordResetDialog.jsx b/client/containers/Users/Dialogs/PasswordResetDialog.jsx index 909483f1d..4e0e4bf13 100644 --- a/client/containers/Users/Dialogs/PasswordResetDialog.jsx +++ b/client/containers/Users/Dialogs/PasswordResetDialog.jsx @@ -6,11 +6,9 @@ import { Error, Confirm } from 'auth0-extension-ui'; import submitForm from '../../../actions/submitForm'; import { userActions } from '../../../actions'; -import getAppsForConnection from '../../../selectors/getAppsForConnection'; import getDialogMessage from './getDialogMessage'; import { getName, mapValues } from '../../../utils/display'; import { - useClientField, useDisabledConnectionField, useDisabledEmailField } from '../../../utils/useDefaultFields'; @@ -22,7 +20,6 @@ export default connectContainer(class extends Component { static stateToProps = (state) => ({ connections: state.connections, passwordReset: state.passwordReset, - appsForConnection: getAppsForConnection(state), settings: (state.settings.get('record') && state.settings.get('record').toJS().settings) || {}, languageDictionary: state.languageDictionary }); @@ -36,15 +33,12 @@ export default connectContainer(class extends Component { cancelPasswordReset: PropTypes.func.isRequired, resetPassword: PropTypes.func.isRequired, connections: PropTypes.object.isRequired, - passwordReset: PropTypes.object.isRequired, - appsForConnection: PropTypes.object + passwordReset: PropTypes.object.isRequired }; shouldComponentUpdate(nextProps) { return nextProps.passwordReset !== this.props.passwordReset || - nextProps.languageDictionary !== this.props.languageDictionary || - // nextProps.settings !== this.props.settings || - nextProps.appsForConnection !== this.props.appsForConnection; + nextProps.languageDictionary !== this.props.languageDictionary } onConfirm = () => { @@ -73,11 +67,10 @@ export default connectContainer(class extends Component { getName(user, userFields, languageDictionary)); const fields = _.cloneDeep(userFields) || []; - useClientField(true, fields, this.props.appsForConnection.toJS()); useDisabledConnectionField(true, fields, connection, connections.get('records').toJS()); useDisabledEmailField(true, fields); - const allowedFields = ['email', 'client', 'connection']; + const allowedFields = ['email', 'connection']; const filteredFields = _.filter(fields, field => _.includes(allowedFields, field.property)); @@ -98,7 +91,7 @@ export default connectContainer(class extends Component { {message}

{ }); const user = req.targetUser; - const data = { email: user.email, connection: req.body.connection, client_id: req.body.clientId }; + const data = { email: user.email, connection: req.body.connection }; return client.requestChangePasswordEmail(data) .then(() => res.sendStatus(204)) .catch(next); diff --git a/tests/client/containers/Users/Dialogs/PasswordResetDialog.tests.js b/tests/client/containers/Users/Dialogs/PasswordResetDialog.tests.js index ce019b742..ad59071cd 100644 --- a/tests/client/containers/Users/Dialogs/PasswordResetDialog.tests.js +++ b/tests/client/containers/Users/Dialogs/PasswordResetDialog.tests.js @@ -90,11 +90,6 @@ describe('#Client-Containers-Users-Dialogs-PasswordResetDialog', () => { .textContent).to.equal(emailLabel); }; - const checkClientLabel = (component, passwordLabel) => { - expect(document.querySelector('label[for=client]') - .textContent).to.equal(passwordLabel); - }; - const checkConfirm = (component, title) => { const confirm = component.find(Confirm); expect(confirm.length).to.equal(1); @@ -108,7 +103,6 @@ describe('#Client-Containers-Users-Dialogs-PasswordResetDialog', () => { ' user allowing them to choose a new password.'); checkConnectionLabel(component, 'Connection'); checkEmailLabel(component, 'Email'); - checkClientLabel(component, 'Client (required)'); checkConfirm(component, 'Reset Password?'); }); @@ -119,7 +113,6 @@ describe('#Client-Containers-Users-Dialogs-PasswordResetDialog', () => { ' user allowing them to choose a new password.'); checkConnectionLabel(component); checkEmailLabel(component, 'Email'); - checkClientLabel(component, 'Client (required)'); checkConfirm(component, 'Reset Password?'); }); @@ -131,7 +124,6 @@ describe('#Client-Containers-Users-Dialogs-PasswordResetDialog', () => { ' user allowing them to choose a new password.'); checkConnectionLabel(component, 'Connection'); checkEmailLabel(component, 'Email'); - checkClientLabel(component, 'Client (required)'); checkConfirm(component, 'Reset Password?'); }); @@ -209,7 +201,6 @@ describe('#Client-Containers-Users-Dialogs-PasswordResetDialog', () => { const component = renderComponent({ username: 'john', settings }); checkConnectionLabel(component, 'ConnectionLabel'); checkEmailLabel(component, 'EmailLabel'); - checkClientLabel(component, 'ClientLabel'); }); it('should handle null label name in user fields', () => { @@ -236,6 +227,5 @@ describe('#Client-Containers-Users-Dialogs-PasswordResetDialog', () => { const component = renderComponent({ username: 'john', settings }); checkConnectionLabel(component, 'Connection'); checkEmailLabel(component, 'Email'); - checkClientLabel(component, 'Client'); }); });