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

Moved JWTTokenProvider to lib and exported from index

no-issue

This brings the module in line with our current package standards.
This commit is contained in:
Fabien O'Carroll 2020-09-18 13:20:12 +01:00
parent e38dbc1e6e
commit 97ceb13d42
4 changed files with 3 additions and 4 deletions

View file

@ -15,7 +15,6 @@ or
const crypto = require('crypto');
const nodemailer = require('nodemailer');
const MagicLink = require('@tryghost/magic-link');
const JWTTokenProvider = require('@tryghost/magic-link/JWTTokenProvider');
async function main() {
const jwtSecret = crypto.randomBytes(16).toString('hex');
@ -37,7 +36,7 @@ async function main() {
});
const service = MagicLink({
tokenProvider: new JWTTokenProvider(jwtSecret),
tokenProvider: new MagicLink.JWTTokenProvider(jwtSecret),
transporter,
getSigninURL(token) {
return `http://example.com/signin?token=${token}`

View file

@ -139,3 +139,4 @@ function defaultGetSubject(type) {
}
module.exports = MagicLink;
module.exports.JWTTokenProvider = require('./lib/JWTTokenProvider');

View file

@ -1,7 +1,6 @@
const _ = require('lodash');
const {Router} = require('express');
const body = require('body-parser');
const JWTTokenProvider = require('@tryghost/magic-link/JWTTokenProvider');
const MagicLink = require('@tryghost/magic-link');
const StripePaymentProcessor = require('./lib/stripe');
const Tokens = require('./lib/tokens');
@ -94,7 +93,7 @@ module.exports = function MembersApi({
const magicLinkService = new MagicLink({
transporter,
tokenProvider: new JWTTokenProvider(secret),
tokenProvider: new MagicLink.JWTTokenProvider(secret),
getSigninURL,
getText,
getHTML,