diff --git a/admin/.env.dist b/admin/.env.dist index 1419552be..66c84dda8 100644 --- a/admin/.env.dist +++ b/admin/.env.dist @@ -1,4 +1,4 @@ GRAPHQL_URI=http://localhost:4000/graphql -WALLET_AUTH_URL=http://localhost/authenticate?token=$token +WALLET_AUTH_URL=http://localhost/authenticate?token={token} WALLET_URL=http://localhost/login DEBUG_DISABLE_AUTH=false \ No newline at end of file diff --git a/admin/src/components/NavBar.vue b/admin/src/components/NavBar.vue index 12936f554..0e8ad8acf 100644 --- a/admin/src/components/NavBar.vue +++ b/admin/src/components/NavBar.vue @@ -38,7 +38,7 @@ export default { this.$store.dispatch('logout') }, wallet() { - window.location = CONFIG.WALLET_AUTH_URL.replace('$token', this.$store.state.token) + window.location = CONFIG.WALLET_AUTH_URL.replace('{token}', this.$store.state.token) this.$store.dispatch('logout') // logout without redirect }, }, diff --git a/admin/src/config/index.js b/admin/src/config/index.js index 6e338fe9c..f7d361c12 100644 --- a/admin/src/config/index.js +++ b/admin/src/config/index.js @@ -19,7 +19,7 @@ const environment = { const endpoints = { GRAPHQL_URI: process.env.GRAPHQL_URI || 'http://localhost:4000/graphql', - WALLET_AUTH_URL: process.env.WALLET_AUTH_URL || 'http://localhost/authenticate?token=$token', + WALLET_AUTH_URL: process.env.WALLET_AUTH_URL || 'http://localhost/authenticate?token={token}', WALLET_URL: process.env.WALLET_URL || 'http://localhost/login', } diff --git a/backend/.env.dist b/backend/.env.dist index 1238d0f81..2f7f02a78 100644 --- a/backend/.env.dist +++ b/backend/.env.dist @@ -19,8 +19,8 @@ DB_DATABASE=gradido_community #RESEND_TIME= RESEND_TIME=10 -#EMAIL_LINK_VERIFICATION=http://localhost/checkEmail/$code -#EMAIL_LINK_SETPASSWORD=http://localhost/reset/$code +#EMAIL_LINK_VERIFICATION=http://localhost/checkEmail/{code} +#EMAIL_LINK_SETPASSWORD=http://localhost/reset/{code} #KLICKTIPP_USER= #KLICKTIPP_PASSWORD= diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index 9306b2867..4269802aa 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -51,8 +51,8 @@ const email = { EMAIL_SMTP_URL: process.env.EMAIL_SMTP_URL || 'gmail.com', EMAIL_SMTP_PORT: process.env.EMAIL_SMTP_PORT || '587', EMAIL_LINK_VERIFICATION: - process.env.EMAIL_LINK_VERIFICATION || 'http://localhost/checkEmail/$code', - EMAIL_LINK_SETPASSWORD: process.env.EMAIL_LINK_SETPASSWORD || 'http://localhost/reset/$code', + process.env.EMAIL_LINK_VERIFICATION || 'http://localhost/checkEmail/{code}', + EMAIL_LINK_SETPASSWORD: process.env.EMAIL_LINK_SETPASSWORD || 'http://localhost/reset/{code}', RESEND_TIME: isNaN(resendTime) ? 10 : resendTime, } diff --git a/backend/src/graphql/resolver/UserResolver.test.ts b/backend/src/graphql/resolver/UserResolver.test.ts index e5b7b9221..8aaf3b69e 100644 --- a/backend/src/graphql/resolver/UserResolver.test.ts +++ b/backend/src/graphql/resolver/UserResolver.test.ts @@ -162,7 +162,7 @@ describe('UserResolver', () => { describe('account activation email', () => { it('sends an account activation email', () => { - const activationLink = CONFIG.EMAIL_LINK_VERIFICATION.replace(/\$code/g, emailOptIn) + const activationLink = CONFIG.EMAIL_LINK_VERIFICATION.replace(/{code}/g, emailOptIn) expect(sendAccountActivationEmail).toBeCalledWith({ link: activationLink, firstName: 'Peter', diff --git a/backend/src/graphql/resolver/UserResolver.ts b/backend/src/graphql/resolver/UserResolver.ts index e0afe1d19..83e915bc7 100644 --- a/backend/src/graphql/resolver/UserResolver.ts +++ b/backend/src/graphql/resolver/UserResolver.ts @@ -448,7 +448,7 @@ export class UserResolver { const emailOptIn = await createEmailOptIn(loginUserId, queryRunner) const activationLink = CONFIG.EMAIL_LINK_VERIFICATION.replace( - /\$code/g, + /{code}/g, emailOptIn.verificationCode.toString(), ) const emailSent = await sendAccountActivationEmail({ @@ -486,7 +486,7 @@ export class UserResolver { const emailOptIn = await createEmailOptIn(loginUser.id, queryRunner) const activationLink = CONFIG.EMAIL_LINK_VERIFICATION.replace( - /\$code/g, + /{code}/g, emailOptIn.verificationCode.toString(), ) @@ -523,7 +523,7 @@ export class UserResolver { const optInCode = await getOptInCode(loginUser) const link = CONFIG.EMAIL_LINK_SETPASSWORD.replace( - /\$code/g, + /{code}/g, optInCode.verificationCode.toString(), ) diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index 19a13515a..684dc1eab 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -21,15 +21,15 @@ EMAIL_USERNAME=peter@lustig.de EMAIL_SENDER=peter@lustig.de EMAIL_PASSWORD=1234 EMAIL_SMTP_URL=smtp.lustig.de -EMAIL_LINK_VERIFICATION=https://stage1.gradido.net/checkEmail/$code -EMAIL_LINK_SETPASSWORD=https://stage1.gradido.net/reset/$code +EMAIL_LINK_VERIFICATION=https://stage1.gradido.net/checkEmail/{code} +EMAIL_LINK_SETPASSWORD=https://stage1.gradido.net/reset/{code} WEBHOOK_ELOPAGE_SECRET=secret # frontend GRAPHQL_URI=https://stage1.gradido.net/graphql -ADMIN_AUTH_URL=https://stage1.gradido.net/admin/authenticate?token=$token +ADMIN_AUTH_URL=https://stage1.gradido.net/admin/authenticate?token={token} # admin -WALLET_AUTH_URL=https://stage1.gradido.net/authenticate?token=$token +WALLET_AUTH_URL=https://stage1.gradido.net/authenticate?token={token} WALLET_URL=https://stage1.gradido.net/login \ No newline at end of file diff --git a/frontend/.env.dist b/frontend/.env.dist index 212290f2d..f7bda826a 100644 --- a/frontend/.env.dist +++ b/frontend/.env.dist @@ -1,3 +1,3 @@ GRAPHQL_URI=http://localhost/graphql DEFAULT_PUBLISHER_ID=2896 -ADMIN_AUTH_URL=http://localhost/admin/authenticate?token=$token \ No newline at end of file +ADMIN_AUTH_URL=http://localhost/admin/authenticate?token={token} \ No newline at end of file diff --git a/frontend/src/config/index.js b/frontend/src/config/index.js index 73ce85fa3..7e213e1d9 100644 --- a/frontend/src/config/index.js +++ b/frontend/src/config/index.js @@ -20,7 +20,7 @@ const environment = { const endpoints = { GRAPHQL_URI: process.env.GRAPHQL_URI || 'http://localhost/graphql', - ADMIN_AUTH_URL: process.env.ADMIN_AUTH_URL || 'http://localhost/admin/authenticate?token=$token', + ADMIN_AUTH_URL: process.env.ADMIN_AUTH_URL || 'http://localhost/admin/authenticate?token={token}', } const options = {} diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.vue b/frontend/src/views/Layout/DashboardLayout_gdd.vue index d26d9325e..abee36082 100755 --- a/frontend/src/views/Layout/DashboardLayout_gdd.vue +++ b/frontend/src/views/Layout/DashboardLayout_gdd.vue @@ -108,7 +108,7 @@ export default { this.balance -= ammount }, admin() { - window.location.assign(CONFIG.ADMIN_AUTH_URL.replace('$token', this.$store.state.token)) + window.location.assign(CONFIG.ADMIN_AUTH_URL.replace('{token}', this.$store.state.token)) this.$store.dispatch('logout') // logout without redirect }, setVisible(bool) {