You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
452 B

  1. <?php
  2. namespace App\Controllers;
  3. use Movim\Controller\Base;
  4. use Movim\Cookie;
  5. class DisconnectController extends Base
  6. {
  7. public function dispatch()
  8. {
  9. // Just in case
  10. if ($this->user) {
  11. $this->user->encryptedPasswords()->delete();
  12. requestAPI('disconnect', post: ['sid' => $this->user->session->id]);
  13. }
  14. // Fresh cookie
  15. Cookie::renew();
  16. $this->redirect('login');
  17. }
  18. }