1
0
mirror of https://github.com/delight-im/PHP-Auth.git synced 2025-08-02 14:17:26 +02:00

Add tests for new method 'logOutButKeepSession' in class 'Auth'

This commit is contained in:
Marco
2017-09-18 16:10:19 +02:00
parent 404739634d
commit 16bcfa85ef

View File

@@ -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>';