File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -373,12 +373,17 @@ func oauthCallbackHandler(w http.ResponseWriter, r *http.Request) {
373
373
urlPath := sess .Get ("path" ).(string )
374
374
sessLock .Unlock ()
375
375
if Config .Verbose > 0 {
376
+ log .Printf ("response data %+v" , resp )
376
377
log .Println ("session data" , string (data ))
377
378
log .Println ("redirect to" , urlPath )
378
379
}
379
- if accessToken , ok := oauth2Token .Extra ("access_token" ).(string ); ok {
380
+ accessToken := resp .OAuth2Token .AccessToken
381
+ if accessToken != "" {
380
382
bt := fmt .Sprintf ("Bearer %s" , accessToken )
381
383
r .Header .Set ("Authorization" , bt )
384
+ if Config .Verbose > 0 {
385
+ log .Printf ("new http request headers %+v" , r .Header )
386
+ }
382
387
}
383
388
http .Redirect (w , r , urlPath , http .StatusFound )
384
389
return
You can’t perform that action at this time.
0 commit comments