Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trello API authentication popup not closed

I'm trying to demonstrate the Trello API but i'm having issues with the authentication procedure.

var ConnectToTrello = function () {
//console.log("Authenticating");
Trello.authorize({
    type: 'popup',
    name: 'Outlook Trello Add-In',
    scope: { read: true, write: true, account: true },
    success: authenticationSuccess,
    error: authenticationError
});};

This opens a popup where I can do the authentication, then I get redirected (in the popup) to https://trello.com/1/token/approve and nothing happens. The popup is not closing.

Any help would be appreciated.

download the code here

like image 850
Gene Vangampelaere Avatar asked Dec 23 '15 09:12

Gene Vangampelaere


1 Answers

I had the same issue until I tried running the ConnectToTrello function from a button. If you create a simple page with that javascript snippet being executed in the <script> block it exhibits the behaviour you describe.

However, if you add a simple button with that function as the onclick event handler, then it works just fine.

<button onclick="ConnectToTrello();">press me!</button>
like image 189
Hamish Avatar answered Oct 21 '22 09:10

Hamish