mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 11:54:33 +03: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
@ -237,12 +237,13 @@ class MembersConfigProvider {
|
||||
};
|
||||
}
|
||||
|
||||
getSigninURL(token, type) {
|
||||
getSigninURL(token, type, requestSrc) {
|
||||
const siteUrl = this._urlUtils.getSiteUrl();
|
||||
const signinURL = new URL(siteUrl);
|
||||
signinURL.pathname = path.join(signinURL.pathname, '/members/');
|
||||
const actionParam = requestSrc === 'portal' ? 'portal-action' : 'action';
|
||||
signinURL.searchParams.set('token', token);
|
||||
signinURL.searchParams.set('action', type);
|
||||
signinURL.searchParams.set(actionParam, type);
|
||||
return signinURL.href;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user