public static function verifyUser($payload)
    {
        $userId = $payload->get('user_id');
        $userKey = $payload->get('sub');
        $userInfo = ($userId) ? User::getCachedInfo($userId) : null;

        if (!empty($userInfo) && $userKey === md5($userInfo['email'])) {
            return true;
        } else {
            throw new TokenInvalidException('User verification failed.');
        }
    }
public static function verifyUser($payload)
    {
        $userId = $payload->get('user_id');
        $userKey = $payload->get('sub');
        $userInfo = ($userId) ? User::getCachedInfo($userId) : null;

        if (!empty($userInfo) && $userKey === md5($userInfo['email'])) {
            return true;
        } else {
            throw new TokenInvalidException('User verification failed.');
        }
    }
public static function verifyUser ( $ payload ) { $ userId = $ payload -> get ( 'user_id' ) ; $ userKey = $ payload -> get ( 'sub' ) ; $ userInfo = ( $ userId ) ? User :: getCachedInfo ( $ userId ) : null ; if ( ! empty ( $ userInfo ) && $ userKey === md5 ( $ userInfo [ 'email' ] ) ) { return true ; } else { throw new TokenInvalidException ( 'User verification failed.' ) ; } }
Verifies JWT user.

@param Payload $payload

@return bool
@throws TokenInvalidException
Verifies JWT user .