Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make preProcessRequest return a promise (or give middleware access to the Request) #116

Open
codeOfRobin opened this issue Feb 17, 2019 · 1 comment

Comments

@codeOfRobin
Copy link

Hi Vadym!

We have an Auth SDK at work that exposes a simple function:

public func addAuthentication(to request: Request, completion: (TypedResult<Request, TokenStorageError>) -> Void) 

(since we don't want clients to have access to the access tokens directly)

Since this API works asynchronously, we can't add this to preProcessRequest (which is synchronous) or to middleware (since that doesn't have access to the request). Is there a "right" way to do this?

@vadymmarkov
Copy link
Owner

I'm afraid it's not possible with the current implementation. Perhaps preProcessRequest should be turned into async function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants