-
Notifications
You must be signed in to change notification settings - Fork 146
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
Use the router to get the correct path from the connect facebook check route #96
Conversation
README.md
Outdated
@@ -266,7 +266,7 @@ class MyFacebookAuthenticator extends SocialAuthenticator | |||
public function supports(Request $request) | |||
{ | |||
// continue ONLY if the URL matches the check URL | |||
return $request->getPathInfo() == '/connect/facebook/check'; | |||
return $request->getPathInfo() == $this->router->getRouteCollection()->get('connect_facebook_check')->getPath(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't just $this->router->generate('connect_facebook_check')
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would add a host when the route has a host defined or?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't add a host, but I'm actually not sure if you have the host defined - good point :).
But, there another option anyways, where we look specifically at the route name:
return $request->attributes->get('_route') == 'connect_facebook_check';
Do you guys like that better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for me did update the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Thank you! |
Prevent problems like: #39