Skip to content

Commit 7dabfaf

Browse files
committed
fix
1 parent b76bbf4 commit 7dabfaf

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

spec/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ describe('server', () => {
686686
.catch(done.fail);
687687
});
688688

689-
fdescribe('publicServerURL', () => {
689+
describe('publicServerURL', () => {
690690
it('should load publicServerURL', async () => {
691691
await reconfigureServer({
692692
publicServerURL: () => 'https://example.com/1',

src/Config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ export class Config {
183183
userController,
184184
appName,
185185
publicServerURL,
186+
_publicServerURL,
186187
emailVerifyTokenValidityDuration,
187188
emailVerifyTokenReuseIfValid,
188189
}) {
@@ -191,7 +192,7 @@ export class Config {
191192
this.validateEmailConfiguration({
192193
emailAdapter,
193194
appName,
194-
publicServerURL,
195+
publicServerURL: publicServerURL || _publicServerURL,
195196
emailVerifyTokenValidityDuration,
196197
emailVerifyTokenReuseIfValid,
197198
});
@@ -474,7 +475,7 @@ export class Config {
474475
if (typeof appName !== 'string') {
475476
throw 'An app name is required for e-mail verification and password resets.';
476477
}
477-
if (typeof publicServerURL !== 'string') {
478+
if (typeof publicServerURL !== 'string' && typeof publicServerURL !== 'function') {
478479
throw 'A public server url is required for e-mail verification and password resets.';
479480
}
480481
if (emailVerifyTokenValidityDuration) {

src/Routers/UsersRouter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ export class UsersRouter extends ClassesRouter {
418418
Config.validateEmailConfiguration({
419419
emailAdapter: req.config.userController.adapter,
420420
appName: req.config.appName,
421-
publicServerURL: req.config.publicServerURL,
421+
publicServerURL: req.config.publicServerURL || req.config._publicServerURL,
422422
emailVerifyTokenValidityDuration: req.config.emailVerifyTokenValidityDuration,
423423
emailVerifyTokenReuseIfValid: req.config.emailVerifyTokenReuseIfValid,
424424
});

0 commit comments

Comments
 (0)