diff --git a/Migration.md b/Migration.md index 3b59410..b6d480a 100644 --- a/Migration.md +++ b/Migration.md @@ -18,6 +18,8 @@ $ composer update delight-im/auth ## From `v6.x.x` to `v7.x.x` + * The method `logOutButKeepSession` from class `Auth` is now simply called `logOut`. Therefore, the former method `logout` is now called `logOutAndDestroySession`. With both methods, mind the capitalization of the letter “O”. + ## From `v5.x.x` to `v6.x.x` * The database schema has changed. diff --git a/README.md b/README.md index c5a3c5e..8691f26 100644 --- a/README.md +++ b/README.md @@ -407,9 +407,9 @@ $url = 'https://www.example.com/verify_email?selector=' . \urlencode($selector) ### Logout ```php -$auth->logOutButKeepSession(); +$auth->logOut(); // or -$auth->logout(); +$auth->logOutAndDestroySession(); // user has been signed out ``` diff --git a/src/Auth.php b/src/Auth.php index 44019e4..f395ae1 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -339,7 +339,7 @@ final class Auth extends UserManager { * * @throws AuthError if an internal problem occurred (do *not* catch) */ - public function logOutButKeepSession() { + public function logOut() { // if the user has been signed in if ($this->isLoggedIn()) { // get the user's ID @@ -534,8 +534,8 @@ final class Auth extends UserManager { * * @throws AuthError if an internal problem occurred (do *not* catch) */ - public function logout() { - $this->logOutButKeepSession(); + public function logOutAndDestroySession() { + $this->logOut(); $this->destroySession(); } diff --git a/tests/index.php b/tests/index.php index 3fd2d7f..669e9fe 100644 --- a/tests/index.php +++ b/tests/index.php @@ -357,13 +357,13 @@ function processRequestData(\Delight\Auth\Auth $auth) { return 'not logged in'; } } - else if ($_POST['action'] === 'logOutButKeepSession') { - $auth->logOutButKeepSession(); + else if ($_POST['action'] === 'logOut') { + $auth->logOut(); return 'ok'; } - else if ($_POST['action'] === 'logout') { - $auth->logout(); + else if ($_POST['action'] === 'logOutAndDestroySession') { + $auth->logOutAndDestroySession(); return 'ok'; } @@ -672,13 +672,13 @@ function showAuthenticatedUserForm(\Delight\Auth\Auth $auth) { echo ''; echo '
'; - echo ''; - echo ''; + echo ''; + echo ''; echo '
'; echo '
'; - echo ''; - echo ''; + echo ''; + echo ''; echo '
'; }