Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

$sharedComponents = $this->sharedComponents; $email = $data['email']; ..

Decoded Output download

<?   $sharedComponents = $this->sharedComponents; 
         
        $email = $data['email']; 
        $password = $data['password']; 
 
        $whereValues = array( 
            'email' => $email 
        ); 
 
        $selectResult = $sharedComponents->selectData("accounts", $whereValues, ""); 
 
        if (!isset($selectResult) || $selectResult["response"] != true) 
        { 
            return ['response' => false, 'message' => 'User Account Email does not exists']; 
        } 
        else 
        { 
            if ($selectResult && password_verify($password . $selectResult['data']['salt'], $selectResult['data']['password']))  
            { 
                // Generate a JWT token 
                $key = $config; 
                $payload = [ 
                    'trackingReference' => $selectResult['data']['trackingReference'], 
                    'email' => $selectResult['data']['email'], 
                    'userType' => "client" 
                    //'exp' => time() + 3600 // Token expiration time (1 hour) 
                ]; 
                $token = JWT::encode($payload, $key, 'HS256'); 
                 
                return ['response' => true, 'message' => "Authentication Successful", 'token' => $token]; 
            } 
            else 
            { 
                return ['response' => false, 'message' => 'Incorrect Password']; 
            } 
        } ?>

Did this file decode correctly?

Original Code

 $sharedComponents = $this->sharedComponents;
        
        $email = $data['email'];
        $password = $data['password'];

        $whereValues = array(
            'email' => $email
        );

        $selectResult = $sharedComponents->selectData("accounts", $whereValues, "");

        if (!isset($selectResult) || $selectResult["response"] != true)
        {
            return ['response' => false, 'message' => 'User Account Email does not exists'];
        }
        else
        {
            if ($selectResult && password_verify($password . $selectResult['data']['salt'], $selectResult['data']['password'])) 
            {
                // Generate a JWT token
                $key = $config;
                $payload = [
                    'trackingReference' => $selectResult['data']['trackingReference'],
                    'email' => $selectResult['data']['email'],
                    'userType' => "client"
                    //'exp' => time() + 3600 // Token expiration time (1 hour)
                ];
                $token = JWT::encode($payload, $key, 'HS256');
                
                return ['response' => true, 'message' => "Authentication Successful", 'token' => $token];
            }
            else
            {
                return ['response' => false, 'message' => 'Incorrect Password'];
            }
        }

Function Calls

None

Variables

None

Stats

MD5 3c5f0c835b1758bed01724ac079c4b20
Eval Count 0
Decode Time 76 ms