0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-18 02:21:47 -05:00

Added default value for request src

no issue

`getSigninUrl` takes an optional param `requestSrc` to allow customizing signin url based on source like Portal. Fixes tests and adds default value in case no `requestSrc` is present.
This commit is contained in:
Rish 2020-10-29 12:10:28 +05:30
parent 216aeb572e
commit 1ba68ce72f
2 changed files with 2 additions and 2 deletions

View file

@ -53,7 +53,7 @@ class MagicLink {
const token = await this.tokenProvider.create(options.tokenData);
const type = options.type || 'signin';
const requestSrc = options.requestSrc;
const requestSrc = options.requestSrc || '';
const url = this.getSigninURL(token, type, requestSrc);

View file

@ -35,7 +35,7 @@ describe('MagicLink', function () {
const {token} = await service.sendMagicLink(args);
should.ok(options.getSigninURL.calledOnce);
should.ok(options.getSigninURL.firstCall.calledWithExactly(token, 'blazeit'));
should.ok(options.getSigninURL.firstCall.calledWithExactly(token, 'blazeit', ''));
should.ok(options.getText.calledOnce);
should.ok(options.getText.firstCall.calledWithExactly('FAKEURL', 'blazeit', 'test@example.com'));