plugins-legacy
plugins-legacy copied to clipboard
Add Asana Integration
Login with google not working yet, try to wrap google oauth in popup, but it's return nothing after success auth.
Oauth popup issue #78
Alright so I figured out how to do Asana. I'm sure there is a way to hook into this via the webview.js, and it's only going to work for Asana, since they are nice enough to (1) not minify their code (2) have some oauth code in there for whatever reason (3) have a pretty shameless function onclick for that button. Thank you Asana. Never change.
-
Set
"openDevTools": true -
When you arrive at the login screen, use dev tools to select the "Login with Google" Button to find it in the sourcecode
-
You should see something similar to this:
<div tabindex="0" class="buttonView buttonView--primary buttonView--large" id="google_auth_button" onclick="return Dialog.Login.loginWithGoogle(false, 'https://app.asana.com/-/oauth2callback', 'https:\/\/app.asana.com\/')"><span>Use Google Account</span></div> -
Change the "false" to "true"
-
In case you are interested, this argument is whether to initiate oAuth via redirects or popup. True = redirects. This is what we want, as the iframe/popup method can't talk between Franz app <-> Chrome
-
Click the button.
-
Your Chrome or Popup or whatever will likely appear. Don't get distracted. Instead, return to your Franz and you should also see a Google login in-frame as well.
-
Login.
-
Done.
Yeah if you just add:
const getMessages = () => {
const googleButton = document.getElementById('google_auth_button');
if (googleButton) {
googleButton.onclick = function(){ return Dialog.Login.loginWithGoogle(true, 'https://app.asana.com/-/oauth2callback', 'https:\/\/app.asana.com\/') } ;
}
...
...
...
}
It works.
Thanks @tayvano Now it works.