Open gaqzi opened 11 years ago
Think I'll use this django-mobi for mobile instead and change it from request.is_mobile
to request.mobile
. Also has detection for tablets in case that'd be needed as some point.
How come you changed to mobile? request.is_secure() and request.is_ajax() seem to be the established convention.
I'm having trouble understanding the misconfiguration issue.
Also why is it a problem that tablets can visit tabs, isn't that a good thing? Or is it that the client wants to force tablets to mobile, in which case we want to override the normal behavior?
@Celc The latter.I don't remember exactly how it all went, but there was some step in the login that failed when the user was visiting the tab for the first time on a tablet.
When all the redirects were done it was then sent over to apps.facebook.com, which in turn sent the user to the mobile version of the app. And that caused another redirect and Facebook spat out a misconfigured error because we were telling the mobile version to use the desktop version of apps.facebook.com.
The iPad and other tablets can access tabs on Facebook pages.
This means they don't get touched by the current mobile workflow and thus gets redirected back to http://apps.facebook.com/[...] when the auth is done. Facebook doesn't like this when it's an app and will raise a misconfigured error.
Example:
The very last request then redirects the user to https://apps.facebook.com/ instead of the mobile url for the app.
My suggested change is to have friendface rely on a middleware for mobile detection in the
FacebookAppAuthMixin
. If the middleware setsis_mobile
toTrue
then the mixin wil itself setis_facebook_mobile
to True and then the normal mobile workflow will ensue.I know you @Celc has been against relying on a mobile detection middleware, since we could rely on Facebook to always tell us when the user is mobile by sending them to the mobile URLs.
I've used a modified middleware from
django-mobile
for m14everyone and it seems to be working well. So I'll package that up asdjango-mobile-detection-middleware
and change it to setis_mobile
onrequest
.I'll add a pull request here that takes those changes in as on the app auth mixin. This will not force mobile detection on anyone, it won't work without the middleware. Unless we should start bundling the middleware with friendface?
Thoughts?