mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Added getSSRToken method to members layer2
no-issue This fetches a token with an audience of the members api to be used with SSR
This commit is contained in:
parent
cd5a9d0c6b
commit
73b18e6566
1 changed files with 7 additions and 0 deletions
|
@ -62,12 +62,19 @@ module.exports = function layer2(options) {
|
|||
return members.getToken({audience, fresh});
|
||||
}
|
||||
|
||||
function getSSRToken({fresh} = {}) {
|
||||
return members.getConfig().then(function ({issuer}) {
|
||||
return members.getToken({audience: issuer, fresh});
|
||||
});
|
||||
}
|
||||
|
||||
function signout() {
|
||||
return members.signout();
|
||||
}
|
||||
|
||||
return Object.assign(members.bus, {
|
||||
getToken,
|
||||
getSSRToken,
|
||||
signout,
|
||||
signin,
|
||||
upgrade,
|
||||
|
|
Loading…
Add table
Reference in a new issue