mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-02 06:10:14 +02:00
Add tests for new method 'logOutButKeepSession' in class 'Auth'
This commit is contained in:
@@ -356,6 +356,11 @@ function processRequestData(\Delight\Auth\Auth $auth) {
|
||||
return 'not logged in';
|
||||
}
|
||||
}
|
||||
else if ($_POST['action'] === 'logOutButKeepSession') {
|
||||
$auth->logOutButKeepSession();
|
||||
|
||||
return 'ok';
|
||||
}
|
||||
else if ($_POST['action'] === 'logout') {
|
||||
$auth->logout();
|
||||
|
||||
@@ -659,6 +664,11 @@ function showAuthenticatedUserForm(\Delight\Auth\Auth $auth) {
|
||||
echo '<button type="submit">Control password resets</button>';
|
||||
echo '</form>';
|
||||
|
||||
echo '<form action="" method="post" accept-charset="utf-8">';
|
||||
echo '<input type="hidden" name="action" value="logOutButKeepSession" />';
|
||||
echo '<button type="submit">Log out but keep session</button>';
|
||||
echo '</form>';
|
||||
|
||||
echo '<form action="" method="post" accept-charset="utf-8">';
|
||||
echo '<input type="hidden" name="action" value="logout" />';
|
||||
echo '<button type="submit">Log out</button>';
|
||||
|
Reference in New Issue
Block a user