Fix password reset, email verification for custom endpoint (#7236)

* fixed incorrect endpoint for password reset and email verification

* added tests
This commit is contained in:
Manuel
2021-03-03 00:53:02 +01:00
committed by GitHub
parent add67fdd22
commit d789ca6b40
2 changed files with 88 additions and 3 deletions

View File

@@ -451,7 +451,7 @@ export class Config {
}
get requestResetPasswordURL() {
return `${this.publicServerURL}/apps/${this.applicationId}/request_password_reset`;
return `${this.publicServerURL}/${this.pagesEndpoint}/${this.applicationId}/request_password_reset`;
}
get passwordResetSuccessURL() {
@@ -466,7 +466,15 @@ export class Config {
}
get verifyEmailURL() {
return `${this.publicServerURL}/apps/${this.applicationId}/verify_email`;
return `${this.publicServerURL}/${this.pagesEndpoint}/${this.applicationId}/verify_email`;
}
// TODO: Remove this function once PagesRouter replaces the PublicAPIRouter;
// the (default) endpoint has to be defined in PagesRouter only.
get pagesEndpoint() {
return this.pages && this.pages.enableRouter && this.pages.pagesEndpoint
? this.pages.pagesEndpoint
: 'apps';
}
}