mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-02 14:17:26 +02:00
Add tests for method 'logOutEverywhereElse' from class 'Auth'
This commit is contained in:
@@ -383,6 +383,16 @@ function processRequestData(\Delight\Auth\Auth $auth) {
|
|||||||
|
|
||||||
return 'ok';
|
return 'ok';
|
||||||
}
|
}
|
||||||
|
else if ($_POST['action'] === 'logOutEverywhereElse') {
|
||||||
|
try {
|
||||||
|
$auth->logOutEverywhereElse();
|
||||||
|
}
|
||||||
|
catch (\Delight\Auth\NotLoggedInException $e) {
|
||||||
|
return 'not logged in';
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'ok';
|
||||||
|
}
|
||||||
else if ($_POST['action'] === 'logOutEverywhere') {
|
else if ($_POST['action'] === 'logOutEverywhere') {
|
||||||
try {
|
try {
|
||||||
$auth->logOutEverywhere();
|
$auth->logOutEverywhere();
|
||||||
@@ -817,6 +827,11 @@ function showAuthenticatedUserForm(\Delight\Auth\Auth $auth) {
|
|||||||
echo '<button type="submit">Log out</button>';
|
echo '<button type="submit">Log out</button>';
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
|
||||||
|
echo '<form action="" method="post" accept-charset="utf-8">';
|
||||||
|
echo '<input type="hidden" name="action" value="logOutEverywhereElse" />';
|
||||||
|
echo '<button type="submit">Log out everywhere else</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="logOutEverywhere" />';
|
echo '<input type="hidden" name="action" value="logOutEverywhere" />';
|
||||||
echo '<button type="submit">Log out everywhere</button>';
|
echo '<button type="submit">Log out everywhere</button>';
|
||||||
|
Reference in New Issue
Block a user