-
Notifications
You must be signed in to change notification settings - Fork 7
Work with 0.8.2 meteor auth #5
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
Conversation
Since we do not rely on executeScript this will work if Content Security Policy prevents inline scripts.
|
@faceyspacey I did not include that regex modification to make it work for twitter because it broke the LinkedIn oauth. Do you have one that works for all providers? |
|
@jperl no but it's simple enough to add another OR clause |
…ctly in patch_window.
…uthentication. Remove android show setInterval hack because it breaks the behavior of the InAppBrowser closing when the user presses back. Since loadstop is called without it it is not necessary.
|
@faceyspacey K I checked in some code that should work. Would you mind testing it to see if it works for you? |
Also handle exit event -- if the user presses back, close the window.
otherwise it will throw an exception
|
@AdamBrodzinski Have you had a chance to check this out yet? |
|
@jperl Not yet, it's on my todo list for tonight or tomorrow though! |
|
@jperl I'll try to finish testing on Android tonight... not sure how that will go, my eclipse was botched the last time I tried to compile. There's a copy running in debug mode on http://oauth-demo.meteor.com with this patch (minus the require mentioned above) if anyone wants to try it out. I can confirm that if I comment out/change the IAB require, the LinkedIn OAuth and Twitter OAuth are working on iOS7 👍 🍻 |
|
@AdamBrodzinski Glad it works on twitter. I didn't even test that 😃 |
Replace setInterval show hack with setInterval exec hack. This will solve problems for other plugins as well.
|
@AdamBrodzinski FYI just committed an improved hack for fixing the event listener callbacks never firing. |
|
@jperl Oh wow, I wish I would have seen that a month ago! I lost a lot of hair trying to get the video capture to work. It was only firing the callback on the 2nd capture. 😦 I'm hoping to test on the Galaxy S3 tonight and if all goes well on the Genymotion emulators. I def. want to ship this when 0.8.2 is out! |
|
@AdamBrodzinski Yeah I was running into the same problem w the dialog prompt until I tried this. It works on my nexus 5, I hope it works on the S3. fingers crossed |
|
@jperl @AdamBrodzinski can you guys send me the code. I was running into the same issue with capture callbacks. I'd like to use it since I know Adam is really busy. |
|
@faceyspacey Not sure what you mean exactly. Send you the code that is in this PR? The code that fixes the plugin callbacks is here https://github.com/jperl/meteor-phonegap-oauth/blob/master/patch_window.js#L20-L29 |
|
oops my bad. i didnt see that i can get it. awesome brother. thanks! |
|
@faceyspacey NP. Let me know if it works for you. |
|
hey guys, I'll test that in short as well. But did I got it right, that this will not working with cordova 3.3? Only with 3.4 and 3.5? Cheers |
|
It will work if you make your own local package and then change the require line to use '.InAppBrowser' instead of the lowercased one (on mobile now so I can't reference it). Phone gap recently changed their JS code in 3.4 or 3.5— On Sun, Jun 22, 2014 at 8:58 AM, tstuber [email protected] wrote:
|
adds functionality to work with new 0.8.2 meteor auth
|
@jperl @faceyspacey thanks for the PRs 🍻 Just tested on Android 4.4 Motox and 4.3 Galaxy S3 and it's working great on both LinkedIn and Twitter 😄 |
|
Awesome! |
Features of this PR:
>= v0.8.2while maintaining support for thebrowser-policypackage, details below.exitevent. This is triggered if the back button is pressed and there is no history (right after it is opened).To support Meteor's latest oauth I patch
OAuth._endOfLoginResponseto append the credentialToken and credentialSecret to the url hash -- and use them to callOAuth._handleCredentialSecretandAccounts.oauth.tryLoginAfterPopupClosed.This method works even if the meteor app is using the
browser-policypackage which prevents inlinescripts from being executed. The
executeScriptmethod used in PR #3 will not work under these restrictions since it uses inline scripts.This PR will only work with Meteor
>= v0.8.2, as it relies onOAuth._endOfLoginResponse.More context here https://groups.google.com/forum/#!topic/meteor-core/Ma3XTZk4Kqg
If meteor/meteor#2220 is accepted we can get rid of theOAuth._endOfLoginResponsepatch.