Test change password with flash message

This commit is contained in:
Nicolò P 2024-10-29 16:16:58 +01:00
parent b3585047be
commit 1d5278eb06
2 changed files with 14 additions and 1 deletions

View File

@ -15,4 +15,12 @@ class ProfileController extends AbstractController
'controller_name' => 'ProfileController',
]);
}
#[Route('/changepasswd', name: 'app_change_passwd')]
public function changePassword(): Response
{
$this->addFlash('notice', 'Password successfully updated');
return $this->redirectToRoute('app_profile');
}
}

View File

@ -43,7 +43,12 @@
</div>
<div class="card ml-6 content">
<form class="card-content" id="change-password">
{% for message in app.flashes('notice') %}
<article class="message is-success">
<div class="message-body">{{ message }}</div>
</article>
{% endfor %}
<form class="card-content" id="change-password" method="post" action="{{ path('app_change_passwd') }}">
<div class="field">
<h3 class="is-size-4 has-text-centered">Change password</h3>
</div>