Skip to content

Skipping authentication when request is cached #384

@ClaraLeigh

Description

@ClaraLeigh

Hey :)

I've been trying to think up a good way to skip authentication if a request has already been cached.

So for example, straight from the docs:

<?php
$connector = new WarehouseConnector;
$authenticator = $connector->getAccessToken();

// Use authenticator to authenticate your connector instance
$connector->authenticate($authenticator);

// Any request sent through this connector will now have authentication applied
$connector->send(new GetInventoryRequest);

If the GetInventoryRequest is cached, the request to fetch a new access token will still occur.

I will likely try and come up with a dirty hack for today to fix this for myself, but I'm wondering if there is a clean way to do this?
ie, have the authentication inside the Request so it only runs if needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions