set cookie

This commit is contained in:
aj 2017-08-30 19:23:33 +00:00
parent a5742d1a2a
commit 7bb0fca116
1 changed files with 14 additions and 1 deletions

View File

@ -688,6 +688,7 @@
console.warn("[implicitGrant] TODO abstract browser bits away");
}
opts._state = undefined;
return OAUTH3.hooks.session.refresh(
opts.session || {
provider_uri: providerUri
@ -695,7 +696,19 @@
, client_uri: opts.client_uri || opts.clientUri
}
, tokens
);
).then(function (session) {
// TODO set cookie with JWT and TTL
return OAUTH3.request({
method: 'POST'
, url: OAUTH3.url.normalize(
(directives.assets || 'https://assets.:hostname/assets/issuer@oauth3.org/session')
.replace(/:hostname/, OAUTH3.uri.normalize(directives.issuer) || OAUTH3.uri.normalize(providerUri))
)
, session: session
}).then(function () {
return session;
});
});
});
}
, _discoverThenImplicitGrant: function(providerUri, opts) {