[add] In system validation for session
This commit is contained in:
@@ -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.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user