Fix returning global message in `start-session`
This commit is contained in:
parent
0cf3897f79
commit
560c50e027
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "fwdekker/death-notifier",
|
||||
"description": "Get notified when a famous person dies.",
|
||||
"version": "0.15.1", "_comment_version": "Also update version in `package.json`!",
|
||||
"version": "0.15.2", "_comment_version": "Also update version in `package.json`!",
|
||||
"type": "project",
|
||||
"license": "MIT",
|
||||
"homepage": "https://git.fwdekker.com/tools/death-notifier",
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "death-notifier",
|
||||
"version": "0.15.1", "_comment_version": "Also update version in `composer.json`!",
|
||||
"version": "0.15.2", "_comment_version": "Also update version in `composer.json`!",
|
||||
"description": "Get notified when a famous person dies.",
|
||||
"author": "Florine W. Dekker",
|
||||
"browser": "dist/bundle.js",
|
||||
|
|
|
@ -59,7 +59,7 @@ try {
|
|||
// Dispatch request
|
||||
$dispatcher = new ActionDispatcher();
|
||||
// GET actions
|
||||
$dispatcher->register_action(new StartSessionAction($user_manager));
|
||||
$dispatcher->register_action(new StartSessionAction($config, $user_manager));
|
||||
$dispatcher->register_action(new GetUserDataAction($user_manager));
|
||||
$dispatcher->register_action(new ListTrackingsAction($tracking_manager));
|
||||
$dispatcher->register_action(new ValidatePasswordResetTokenAction($user_manager));
|
||||
|
|
|
@ -11,6 +11,10 @@ use Exception;
|
|||
*/
|
||||
class StartSessionAction extends Action
|
||||
{
|
||||
/**
|
||||
* @var array the application's configuration
|
||||
*/
|
||||
private readonly array $config;
|
||||
/**
|
||||
* @var UserManager the manager to validate the session through
|
||||
*/
|
||||
|
@ -20,12 +24,14 @@ class StartSessionAction extends Action
|
|||
/**
|
||||
* Constructs a new `StartSessionAction`.
|
||||
*
|
||||
* @param mixed $config the application's configuration
|
||||
* @param UserManager $user_manager the manager to validate the session through
|
||||
*/
|
||||
public function __construct(UserManager $user_manager)
|
||||
public function __construct(array $config, UserManager $user_manager)
|
||||
{
|
||||
parent::__construct(ActionMethod::GET, "start-session");
|
||||
|
||||
$this->config = $config;
|
||||
$this->user_manager = $user_manager;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,9 +66,9 @@ class Util
|
|||
/**
|
||||
* Parses POST values from JSON-based inputs.
|
||||
*
|
||||
* @return array<int|string, mixed> the parsed POST-ed values
|
||||
* @return array<int|string, mixed>|null the parsed POST-ed values
|
||||
*/
|
||||
static function parse_post(): array
|
||||
static function parse_post(): ?array
|
||||
{
|
||||
$output = $_POST;
|
||||
|
||||
|
|
Loading…
Reference in New Issue