Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3.0175 |
Changes | 0 |
1 | <?php defined('BASEPATH') OR exit('No direct script access allowed'); |
||
18 | 1 | public function index() : void { |
|
19 | 1 | $this->header_data['title'] = 'Logout'; |
|
20 | 1 | $this->header_data['page'] = 'logout'; |
|
21 | |||
22 | 1 | if($this->ion_auth->logged_in()) { |
|
23 | //This is called again due to logout not always logging out properly. - https://github.com/benedmunds/CodeIgniter-Ion-Auth/issues/1191#issuecomment-378934024 |
||
24 | $this->ion_auth->logout() && $this->ion_auth->logout(); |
||
25 | } |
||
26 | 1 | $this->session->set_flashdata('notices', 'Logout Successful'); |
|
27 | |||
28 | 1 | delete_cookie('remember_time'); |
|
29 | |||
30 | 1 | redirect('/', 'refresh'); //TODO: Should we have a custom logout page? |
|
31 | } //@codeCoverageIgnore |
||
32 | } |
||
33 |