27 lines
728 B
PHP
27 lines
728 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace MintyPHP\App\Module\Contracts;
|
||
|
|
|
||
|
|
use MintyPHP\App\AppContainer;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Populates module-specific session data after login and cleans up on logout.
|
||
|
|
*
|
||
|
|
* Called from the login flow after successful authentication. When a module is
|
||
|
|
* deactivated, its provider is not called — session keys are simply not set.
|
||
|
|
*/
|
||
|
|
interface SessionProvider
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Populate session keys with module-specific data after successful login.
|
||
|
|
*
|
||
|
|
* @param array<string, mixed> $user The authenticated user record
|
||
|
|
*/
|
||
|
|
public function populate(array $user, AppContainer $container): void;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Remove session keys owned by this module (called on logout).
|
||
|
|
*/
|
||
|
|
public function clear(): void;
|
||
|
|
}
|