diff --git a/app/src/Middleware/VerifyPasswordMiddleware.php b/app/src/Middleware/VerifyPasswordMiddleware.php new file mode 100644 index 0000000..9e8db47 --- /dev/null +++ b/app/src/Middleware/VerifyPasswordMiddleware.php @@ -0,0 +1,33 @@ +getParsedBody(); + + if ($requestData['password'] !== $requestData['checked_password']) { + + $this->session + ->getFlash() + ->add('error', "Passwords do not match."); + $response = $handler->handle($request); + return $response->withStatus(400); + } + + return $handler->handle($request); + } +}