comparison src/google.coffee @ 26:cdbc77880565

try/catch around updateToken
author Mathias Gebbe <mgebbe@intevation.de>
date Tue, 24 Jun 2014 08:32:51 +0200
parents 723eaf36902c
children f27ddfa42e94
comparison
equal deleted inserted replaced
25:723eaf36902c 26:cdbc77880565
251 251
252 252
253 return 253 return
254 254
255 updateToken = (user, callback) -> 255 updateToken = (user, callback) ->
256 token = user.oauth_token.substr(0,user.oauth_token.indexOf(';')) 256 try
257 if user.oauth_token.indexOf(';') isnt -1
258 token = user.oauth_token.substr(0,user.oauth_token.indexOf(';'))
259 else
260 token = user.oauth_token
261 catch err
262 console.log 'Google updateToken error' + err
257 extra = user.extra_token 263 extra = user.extra_token
258 data = "" 264 data = ""
259 post_data = querystring.stringify( 265 post_data = querystring.stringify(
260 "refresh_token": extra 266 "refresh_token": extra
261 "client_id": CLIENTID 267 "client_id": CLIENTID
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)