Skip to content

Conversation

till
Copy link

@till till commented Jul 3, 2014

  • quick and dirty 'hack'
  • thoughts?
 * quick and dirty 'hack' * thoughts?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you opt for doing everything with HttpFoundation\* rather than importing classes directly? Especialy with HttpFoundation\Request this looks kinda clumsy.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simensen Personal preference. I like to group imports vs. having too many of them. But I can I revert it if need be. :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry about it just yet. We can circle back to it if needed. :)

If it were for anything other than HttpFoundation I might not care. :) For consistency, I think it would be better for Request to be used everywhere rather than HttpFoundation\Request to be used in just a handful of places. :)

@simensen
Copy link
Collaborator

simensen commented Jul 3, 2014

It might be a bit over-engineered, and I know you said it was a quick hack, but I feel like I'd rather see some sort of strategy/handler system in here to figure out which thing should be done based on OAuth1 or OAuth2 rather than if/else blocks.

In general, though, I think it is a nice start!

@till
Copy link
Author

till commented Jul 3, 2014

@simensen I was wondering if I should do something based on the oauth_service.class, but didn't really know where to hook into stack to do it better. I could do two controllers, or something. Not sure if that would be less duplication or just cleaner code.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this missing a return value? $token = ... or somesuch? I'm not super familiar with the oauth package so I'm not sure if there is something else that needs to go on here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't, requestAccessToken calls the storage internally.

The original code ($userId) is never used/returned. It could be removed.

 * also introduced 'service_scopes' and 'service_base_url' in configuration
@simensen
Copy link
Collaborator

simensen commented Jul 3, 2014

@till Here are two ways I was thinking about it. Hard to say if either of these would actually be better or not. :)

https://gist.github.com/simensen/cf730a9b8d7a601d7116

@till
Copy link
Author

till commented Jul 4, 2014

@simensen I think I like the second one better.

@till till closed this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants