Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gillesdemey/Cumulus-electron
Browse files Browse the repository at this point in the history
  • Loading branch information
MichielDeMey committed Oct 30, 2015
2 parents 9233448 + b4a7de5 commit 76c6eec
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var debug = process.env.NODE_ENV === 'development'
/**
* Window references
*/
var debugWindow = null
var debugWindow, loginWindow

mb.on('ready', function() {

Expand All @@ -39,7 +39,13 @@ mb.on('ready', function() {
})

function doLogin() {
mb.window.loadUrl('https://soundcloud.com/connect?client_id=f17c1d67b83c86194fad2b1948061c9e&response_type=token&scope=non-expiring&display=next&redirect_uri=cumulus://oauth/callback')
loginWindow = new BrowserWindow({
width: 400,
height: 500,
resizable: false,
'node-integration': false
})
loginWindow.loadUrl('https://soundcloud.com/connect?client_id=f17c1d67b83c86194fad2b1948061c9e&response_type=token&scope=non-expiring&display=next&redirect_uri=cumulus://oauth/callback')
}

function initialize() {
Expand Down Expand Up @@ -68,10 +74,9 @@ mb.on('ready', function() {
var token = querystring.parse(hash).access_token

config.set('access_token', token, function(err) {
if (err)
throw err
else
initialize()
if (err) throw err
if (loginWindow) loginWindow.close()
initialize()
})

})
Expand Down

0 comments on commit 76c6eec

Please sign in to comment.