[add] Injecting dependency
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
class SessionApplication{
|
||||
// The to be connection
|
||||
private $pdo = '';
|
||||
private $cryptographyService;
|
||||
|
||||
function __construct($mysqlSettings, $cryptographyService){
|
||||
// Services
|
||||
@@ -33,9 +34,13 @@ class SessionApplication{
|
||||
|
||||
function newSession($userName, $password){
|
||||
$real = 'slothness';
|
||||
$password = "$2y$12$51mfESaLEGXDT4u9Bd9kiOHEpaJ1Bx4SEcVwsU5K6jVPMNkrnpJAa";
|
||||
|
||||
if($this->cryptographyService->decryptPassword($real, $password)){
|
||||
|
||||
return "yea";
|
||||
}
|
||||
else{
|
||||
"nah";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user