mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-03 22:57:27 +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';
|
return 'not logged in';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ($_POST['action'] === 'logOutButKeepSession') {
|
||||||
|
$auth->logOutButKeepSession();
|
||||||
|
|
||||||
|
return 'ok';
|
||||||
|
}
|
||||||
else if ($_POST['action'] === 'logout') {
|
else if ($_POST['action'] === 'logout') {
|
||||||
$auth->logout();
|
$auth->logout();
|
||||||
|
|
||||||
@@ -659,6 +664,11 @@ function showAuthenticatedUserForm(\Delight\Auth\Auth $auth) {
|
|||||||
echo '<button type="submit">Control password resets</button>';
|
echo '<button type="submit">Control password resets</button>';
|
||||||
echo '</form>';
|
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 '<form action="" method="post" accept-charset="utf-8">';
|
||||||
echo '<input type="hidden" name="action" value="logout" />';
|
echo '<input type="hidden" name="action" value="logout" />';
|
||||||
echo '<button type="submit">Log out</button>';
|
echo '<button type="submit">Log out</button>';
|
||||||
|
Reference in New Issue
Block a user