File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff 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' ,
Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff 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 } ) ;
You can’t perform that action at this time.
0 commit comments