Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
davibe committed Sep 13, 2016
1 parent 01f2e57 commit 5d7f127
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/login.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ module.exports = (mainWindow) -> Q.Promise (rs) ->
console.log 'login: did-finish-load', url

if url.indexOf('/o/oauth2/programmatic_auth') > 0
console.log 'login: programmatic auth'
# get the cookie from browser session, it has to be there
session.defaultSession.cookies.get {}, (err, values=[]) ->
oauth_code = false
for value in values
if value.name is 'oauth_code'
oauth_code = value.value
rs(oauth_code) if oauth_code
console.log 'login: programmatic auth'
# get the cookie from browser session, it has to be there
session.defaultSession.cookies.get {}, (err, values=[]) ->
oauth_code = false
for value in values
if value.name is 'oauth_code'
oauth_code = value.value
rs(oauth_code) if oauth_code

# redirect to google oauth
mainWindow.loadURL LOGIN_URL

0 comments on commit 5d7f127

Please sign in to comment.