@@ -120,7 +120,7 @@ export class UserController extends AdaptableController {
120
120
// We may need to fetch the user in case of update email
121
121
this . getUserIfNeeded ( user ) . then ( ( user ) => {
122
122
const username = encodeURIComponent ( user . username ) ;
123
- let link = buildVerificationLink ( this . config . verifyEmailURL , username , token ) ;
123
+ let link = buildEmailLink ( this . config . verifyEmailURL , username , token , this . config ) ;
124
124
let options = {
125
125
appName : this . config . appName ,
126
126
link : link ,
@@ -156,7 +156,7 @@ export class UserController extends AdaptableController {
156
156
const token = encodeURIComponent ( user . _perishable_token ) ;
157
157
const username = encodeURIComponent ( user . username ) ;
158
158
159
- let link = buildVerificationLink ( this . config . requestResetPasswordURL , username , token ) ;
159
+ let link = buildEmailLink ( this . config . requestResetPasswordURL , username , token , this . config ) ;
160
160
let options = {
161
161
appName : this . config . appName ,
162
162
link : link ,
@@ -217,12 +217,12 @@ function updateUserPassword(userId, password, config) {
217
217
} ) ;
218
218
}
219
219
220
- function buildVerificationLink ( destination , username , token ) {
220
+ function buildEmailLink ( destination , username , token , config ) {
221
221
let usernameAndToken = `token=${ token } &username=${ username } `
222
222
223
- if ( this . config . parseFrameURL ) {
224
- let destinationWithoutHost = destination . replace ( this . config . publicServerURL , '' ) ;
225
- return `${ this . config . parseFrameURL } ?link=${ encodeURIComponent ( destinationWithoutHost ) } &${ usernameAndToken } ` ;
223
+ if ( config . parseFrameURL ) {
224
+ let destinationWithoutHost = destination . replace ( config . publicServerURL , '' ) ;
225
+ return `${ config . parseFrameURL } ?link=${ encodeURIComponent ( destinationWithoutHost ) } &${ usernameAndToken } ` ;
226
226
} else {
227
227
return `${ destination } ?${ usernameAndToken } ` ;
228
228
}
0 commit comments