-
-
Notifications
You must be signed in to change notification settings - Fork 826
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
Request Uri is wrong if flarum installed in subfolder #778
Comments
I'm not sure, maybe I'm wrong and this is related to login extensions |
Is this in the latest dev-master? |
Yes it's I always keep my installation updated |
Spot on. Or alternatively, |
Hmm, well, that method isn't part of the |
@franzliedke In this case, the URL generator isn't involved; we just want to get the original request URL (before the prefix is stripped as part of the middleware pipe). Perhaps we could just get the |
Yeah, I think I'd prefer that. |
Regression time ! Since beta 8, this issue is again present. After the many reports of people having issue with this on Discuss I finally investigated. The issue presents the same symptoms as the 2016 issue. The redirect url sent by Flarum to the provider does not include the subfolder. It impacts all core login providers. This is because in stragility 1.3.0 (released in November 2016!) zendframework/zend-stratigility#70 the The regression must have been present since beta 7 inclusive, when stragility dependency was bumbed from Because of this, the call to The solution would be to use the new |
Thanks @clarkwinkelmann for investigating! I think we should add the |
How to fix this error now? Or are you guys implementing it into Flarum? |
A workaround that I confirmed working. You can add the following to your
EDIT: added It might require some tweaking depending what is already in the This will redirect all If your root website uses urls starting with |
Thanks for the reply, i changed my |
@Likqez Seems like an
|
Thanks, its working now |
Fixed by adding the middleware to the I will also change the three OAuth extensions to use the URL generator to determine the callback URI, as that feels more correct. Good suggestion. @clarkwinkelmann Let's open new issues when encountering regressions in later versions (issues can only be assigned to one milestone etc.) |
This is helpful when Flarum is installed in subfolders. Fixes flarum#778.
if flarum installed in a subfolder (e.g. http://localhost/flarum)
in a Controller (TwitterAuthController for example) (string) $request->getUri()->withQuery('') will return
http://localhost/auth/twitter
instead ofhttp://localhost/flarum/auth/twitter
I trace down the issue here
please keep in mind this issue is not related to login extensions (twitter, facebook and github).
The text was updated successfully, but these errors were encountered: