Skip to content

Commit 19ef901

Browse files
committed
Show success message to the user
1 parent 435626f commit 19ef901

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

app/Http/Controllers/Auth/ForgotPasswordController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ protected function sendResetLinkFailedResponse(Request $request, $response): Jso
3333
/**
3434
* Get the response for a successful password reset link.
3535
*
36-
* @param string $response
36+
* @param \Illuminate\Http\Request $request
37+
* @param string $response
3738
* @return \Illuminate\Http\JsonResponse
3839
*/
39-
protected function sendResetLinkResponse($response): JsonResponse
40+
protected function sendResetLinkResponse(Request $request, $response): JsonResponse
4041
{
4142
return response()->json([
4243
'status' => trans($response),
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import http from '@/api/http';
22

3-
export default (email: string): Promise<void> => {
3+
export default (email: string): Promise<string> => {
44
return new Promise((resolve, reject) => {
55
http.post('/auth/password', { email })
6-
.then(() => resolve())
6+
.then(response => resolve(response.data.status || ''))
77
.catch(reject);
88
});
99
};

resources/scripts/components/auth/ForgotPasswordContainer.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,12 @@ class ForgotPasswordContainer extends React.PureComponent<Props, State> {
3333
this.setState({ isSubmitting: true }, () => {
3434
this.props.clearAllFlashMessages();
3535
requestPasswordResetEmail(this.state.email)
36-
.then(() => {
37-
// @todo actually handle this.
38-
})
36+
.then(response => this.props.pushFlashMessage({
37+
type: 'success', title: 'Success', message: response,
38+
}))
3939
.catch(error => {
4040
console.error(error);
4141
this.props.pushFlashMessage({
42-
id: 'auth:forgot-password',
4342
type: 'error',
4443
title: 'Error',
4544
message: httpErrorToHuman(error),

0 commit comments

Comments
 (0)