[add] In system validation for session

This commit is contained in:
2018-08-16 01:18:44 -06:00
parent e490f6aed1
commit a05a602954
7 changed files with 36 additions and 28 deletions

View File

@@ -87,6 +87,11 @@ class SessionApplication{
if($this->cryptographyService->decryptPassword($password, $storedPassword)){
$this->session->set('userName', $userName);
if(!$this->verifySession()){
throw new Exception('An error occurred while trying to create the session.');
}
return true;
}
else{
@@ -119,10 +124,15 @@ class SessionApplication{
/**
* @return array
* @throws Exception
*/
function destroySession(){
$this->session->clear();
if($this->verifySession()){
throw new Exception('An error occurred while trying to end the session.');
}
return array('status' => 'success', 'message' => 'Successfully logged out.');
}
}