public function validateLoginToken(string $token): ?array
    {
        $token = base64_decode($token);
        $serializedData = Security::decrypt($token, $this->getKey(), $this->getSalt());
        if ($serializedData === false) {
            return null;
        }
        $data = unserialize($serializedData);
        if (!empty($data['expireInterval']) && !empty($data['timestamp'])) {
            $tokenCreated = new Time($data['timestamp']);
            if (!$tokenCreated->wasWithinLast($data['expireInterval'])) {
                return null;
            }
        }

        return $data;
    }
public function validateLoginToken(string $token): ?array
    {
        $token = base64_decode($token);
        $serializedData = Security::decrypt($token, $this->getKey(), $this->getSalt());
        if ($serializedData === false) {
            return null;
        }
        $data = unserialize($serializedData);
        if (!empty($data['expireInterval']) && !empty($data['timestamp'])) {
            $tokenCreated = new Time($data['timestamp']);
            if (!$tokenCreated->wasWithinLast($data['expireInterval'])) {
                return null;
            }
        }

        return $data;
    }
public function validateLoginToken ( string $ token ) : ? array { $ token = base64_decode ( $ token ) ; $ serializedData = Security :: decrypt ( $ token , $ this -> getKey ( ) , $ this -> getSalt ( ) ) ; if ( $ serializedData === false ) { return null ; } $ data = unserialize ( $ serializedData ) ; if ( ! empty ( $ data [ 'expireInterval' ] ) && ! empty ( $ data [ 'timestamp' ] ) ) { $ tokenCreated = new Time ( $ data [ 'timestamp' ] ) ; if ( ! $ tokenCreated -> wasWithinLast ( $ data [ 'expireInterval' ] ) ) { return null ; } } return $ data ; }
Validates the token.

@param string $token Token
@param string $key   Security key
@param string $salt  Security salt
@return array|null
Validates the token .