From bde50828053915f213216dfbaa08cbead0d85818 Mon Sep 17 00:00:00 2001 From: William Date: Wed, 26 Jan 2022 12:25:17 +0100 Subject: [PATCH] Commit --- app/core/User.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/core/User.php b/app/core/User.php index 36cc687..d58453e 100644 --- a/app/core/User.php +++ b/app/core/User.php @@ -1,6 +1,6 @@ username = $this->session->get('username'); $this->password = $this->session->get('password'); - if (!$this->authenticate($this->username, $this->password)) { + if (!$this->authenticate($this->username, $this->password)) + { $this->logout(); $this->session->flash('Kontodetaljer endret, vennligst logg inn igjen', 'warning'); } @@ -49,7 +50,7 @@ class User // Check if user and pass match private function authenticate(string $username, string $password): bool { - if ($username === 'Willaiam' && $password === 'William') + if ($username === 'William' && $password === 'William') { return TRUE; } @@ -59,8 +60,8 @@ class User public function logout(): void { $this->session->set('loggedIn', FALSE); - $this->session->remove('username', FALSE); - $this->session->remove('password', FALSE); + $this->session->remove('username'); + $this->session->remove('password'); $this->setProperties(); } } \ No newline at end of file