Skip to content

Commit 2c823f0

Browse files
committed
feat(confirmationCodes): add CODE environment variable to pre-define the confirmation codes
1 parent fcbe763 commit 2c823f0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/services/otp.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export const otp = (): string =>
2+
process.env.CODE ??
23
Math.floor(Math.random() * 999999)
34
.toString()
45
.padStart(6, "0");

src/targets/adminCreateUser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const AdminCreateUser =
120120
const now = clock.get();
121121

122122
const temporaryPassword =
123-
req.TemporaryPassword ?? generator.new().slice(0, 6);
123+
req.TemporaryPassword ?? process.env.CODE ?? generator.new().slice(0, 6);
124124

125125
const isEmailUsername =
126126
config.UserPoolDefaults.UsernameAttributes?.includes("email");

0 commit comments

Comments
 (0)