Skip to content

Commit

Permalink
Render auth URL if not able to open browser (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
leo authored Jan 5, 2019
1 parent ded24e0 commit 0f9e0da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
File renamed without changes.
7 changes: 6 additions & 1 deletion lib/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ const requestToken = async () => {
};

authURL += `?${queryString.stringify(params)}`;
open(authURL);

try {
open(authURL);
} catch (err) {
console.error(`Could not open URL in browser. Please open the link: ${authURL}`);
}

const token = await tokenAPI(state);
config.set('token', token);
Expand Down

0 comments on commit 0f9e0da

Please sign in to comment.