Updated init method to take siteUrl named param

This commit is contained in:
Fabien O'Carroll 2019-04-23 15:40:49 +02:00
parent 87690f9a03
commit 5b8fe0f643
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ or
```js
const MembersThemeBindings = require('@tryghost/members-theme-bindings');
MembersThemeBindings.init("http://ghost-site.com/root-ghost-path");
MembersThemeBindings.init({siteUrl: "https://ghost-site.com/root-ghost-path"});
```
## Develop

View File

@ -4,8 +4,8 @@ const browserAuth = require('@tryghost/members-browser-auth');
module.exports.init = init;
function init(membersUrl) {
const auth = browserAuth({membersUrl});
function init({siteUrl}) {
const auth = browserAuth({membersUrl: siteUrl + '/members'});
const [hashMatch, hash, query] = window.location.hash.match(/^#([^?]+)\??(.*)$/) || [];