Skip to content

Commit 57d8961

Browse files
committed
Update OTP token length configuration to allow environment variable override
1 parent 7b6ee61 commit 57d8961

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ module.exports = {
5858
},
5959
login: {
6060
// The length of the token for OTP authentication. Used by passwordless login and reset password.
61-
// Valid values include 6 or 8. Defaults to: 8
62-
tokenLength: 8,
61+
// If the env var `OTP_TOKEN_LENGTH` is set, it will override the config value. Valid values include 6 or 8. Defaults to: 8
62+
tokenLength: process.env.OTP_TOKEN_LENGTH || 8,
6363
passwordless: {
6464
// Enables or disables passwordless login for the site. Defaults to: false
6565
{{#if answers.project.demo.enableDemoSettings}}

packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ module.exports = {
5858
},
5959
login: {
6060
// The length of the token for OTP authentication. Used by passwordless login and reset password.
61-
// Valid values include 6 or 8. Defaults to: 8
62-
tokenLength: 8,
61+
// If the env var `OTP_TOKEN_LENGTH` is set, it will override the config value. Valid values include 6 or 8. Defaults to: 8
62+
tokenLength: process.env.OTP_TOKEN_LENGTH || 8,
6363
passwordless: {
6464
// Enables or disables passwordless login for the site. Defaults to: false
6565
{{#if answers.project.demo.enableDemoSettings}}

packages/template-retail-react-app/config/default.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = {
3030
interpretPlusSignAsSpace: false
3131
},
3232
login: {
33-
tokenLength: 8,
33+
tokenLength: process.env.OTP_TOKEN_LENGTH || 8,
3434
passwordless: {
3535
enabled: false,
3636
mode: 'email',

0 commit comments

Comments
 (0)