-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imprv: Admin user can use reset-password
without email settings
#7650
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ class PasswordResetModal extends React.Component { | |
super(props); | ||
|
||
this.state = { | ||
temporaryPassword: [], | ||
isPasswordResetDone: false, | ||
}; | ||
|
||
|
@@ -25,8 +26,9 @@ class PasswordResetModal extends React.Component { | |
async resetPassword() { | ||
const { t, userForPasswordResetModal } = this.props; | ||
try { | ||
await apiv3Put('/users/reset-password', { id: userForPasswordResetModal._id }); | ||
this.setState({ isPasswordResetDone: true }); | ||
const res = await apiv3Put('/users/reset-password', { id: userForPasswordResetModal._id }); | ||
const { newPassword } = res.data; | ||
this.setState({ temporaryPassword: newPassword, isPasswordResetDone: true }); | ||
} | ||
catch (err) { | ||
toastError(err); | ||
|
@@ -39,8 +41,8 @@ class PasswordResetModal extends React.Component { | |
return ( | ||
<> | ||
<p> | ||
{t('user_management.reset_password_modal.reset_password_info')}<br /> | ||
<span className="text-danger">{t('user_management.reset_password_modal.reset_password_alert')}</span> | ||
{t('user_management.reset_password_modal.password_never_seen')}<br /> | ||
<span className="text-danger">{t('user_management.reset_password_modal.send_new_password')}</span> | ||
</p> | ||
<p> | ||
{t('user_management.reset_password_modal.target_user')}: <code>{userForPasswordResetModal.email}</code> | ||
|
@@ -58,6 +60,9 @@ class PasswordResetModal extends React.Component { | |
<p> | ||
{t('user_management.reset_password_modal.target_user')}: <code>{userForPasswordResetModal.email}</code> | ||
</p> | ||
<p> | ||
{t('user_management.reset_password_modal.new_password')}: <code>{this.state.temporaryPassword}</code> | ||
</p> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 欲を言えば collapse で隠したい There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 後続ストーリーに記載しました。 |
||
</> | ||
); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
後続タスクで使うので残す
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正しました