refreshSession on login as well
This commit is contained in:
		
							parent
							
								
									1425d02f65
								
							
						
					
					
						commit
						35e2a29e4c
					
				| @ -118,6 +118,15 @@ | ||||
|             resolve(tokens); | ||||
|           }; | ||||
|         }); | ||||
|       }).then(function (tokens) { | ||||
|         return OAUTH3.hooks.refreshSession( | ||||
|           opts.session || { | ||||
|             provider_uri: providerUri | ||||
|           , client_id: opts.client_id | ||||
|           , client_uri: opts.client_uri || opts.clientUri | ||||
|           } | ||||
|         , tokens | ||||
|         ); | ||||
|       }); | ||||
|     } | ||||
| 
 | ||||
| @ -260,9 +269,19 @@ | ||||
|           } | ||||
| 
 | ||||
|           return browser.frameRequest(prequest.url, prequest.state, opts); | ||||
|         }).then(function (tokens) { | ||||
|           return OAUTH3.hooks.refreshSession( | ||||
|             opts.session || { | ||||
|               provider_uri: providerUri | ||||
|             , client_id: opts.client_id | ||||
|             , client_uri: opts.client_uri || opts.clientUri | ||||
|             } | ||||
|           , tokens | ||||
|           ); | ||||
|         }); | ||||
|       } | ||||
|     , implicitGrant: function (providerUri, opts) { | ||||
|         // TODO let broker=true change behavior to open discover inline with frameRequest
 | ||||
|         // TODO OAuth3 provider should use the redirect URI as the appId?
 | ||||
|         return OAUTH3.discover(providerUri, opts).then(function (directive) { | ||||
|           var prequest = OAUTH3_CORE.urls.implicitGrant( | ||||
| @ -276,6 +295,15 @@ | ||||
|           } | ||||
| 
 | ||||
|           return browser.frameRequest(prequest.url, prequest.state, opts); | ||||
|         }).then(function (tokens) { | ||||
|           return OAUTH3.hooks.refreshSession( | ||||
|             opts.session || { | ||||
|               provider_uri: providerUri | ||||
|             , client_id: opts.client_id | ||||
|             , client_uri: opts.client_uri || opts.clientUri | ||||
|             } | ||||
|           , tokens | ||||
|           ); | ||||
|         }); | ||||
|       } | ||||
|     , logout: function (providerUri, opts) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user