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

AppEngine compatibility fix #30

Closed
wants to merge 2 commits into from

Conversation

CaptainCodeman
Copy link

Passing a hard-coded oath2.NoContext to oauth2.Config.Exchange breaks AppEngine compatibility following recent changes to golang/appengine and golang/oauth2 to use context.Context (see: golang.org/x/net/context).
Allowing a context to be passed through gothic.CompleteUserAuth / Session.Authorize allows a context to be supplied, e.g.:

ctx := appengine.NewContext(req)
user, err := gothic.CompleteUserAuth(ctx, res, req)

Even if not running on AppEngine, the context is still useful to allow providers to handle timeouts / cancellation but context.TODO() can be passed for the time being.

Passing a hard-coded `oath2.NoContext` to `oauth2.Config.Exchange` breaks AppEngine compatibility following recent changes to golang/appengine and golang/oauth2 to use context.Context (see: golang.org/x/net/context).
Allowing a context to be passed through `gothic.CompleteUserAuth` / `Session.Authorize` allows a context to be supplied, e.g.:

ctx := appengine.NewContext(req)
user, err := gothic.CompleteUserAuth(ctx, res, req)

Even if not running on AppEngine, the context is still useful to allow providers to handle timeouts / cancellation but context.TODO() can be passed for the time being.
@CaptainCodeman
Copy link
Author

I'll look at adding support a different way.

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

Successfully merging this pull request may close these issues.

None yet

1 participant