mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Added custom action param for magic links
closes https://github.com/TryGhost/Ghost/issues/12253 - Allows using custom action param for requests from Portal by using a new `requestSrc` option that is passed down when a request for magic link is made via Portal
This commit is contained in:
parent
6e82934230
commit
746ccbd7ed
1 changed files with 3 additions and 2 deletions
|
@ -237,12 +237,13 @@ class MembersConfigProvider {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
getSigninURL(token, type) {
|
getSigninURL(token, type, requestSrc) {
|
||||||
const siteUrl = this._urlUtils.getSiteUrl();
|
const siteUrl = this._urlUtils.getSiteUrl();
|
||||||
const signinURL = new URL(siteUrl);
|
const signinURL = new URL(siteUrl);
|
||||||
signinURL.pathname = path.join(signinURL.pathname, '/members/');
|
signinURL.pathname = path.join(signinURL.pathname, '/members/');
|
||||||
|
const actionParam = requestSrc === 'portal' ? 'portal-action' : 'action';
|
||||||
signinURL.searchParams.set('token', token);
|
signinURL.searchParams.set('token', token);
|
||||||
signinURL.searchParams.set('action', type);
|
signinURL.searchParams.set(actionParam, type);
|
||||||
return signinURL.href;
|
return signinURL.href;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue