Skip to content

Commit 32a88c1

Browse files
authored
Merge pull request #1940 from mfts/fix/password
fix: encrypt preset password via api
2 parents 0b4d55b + 43bdc1b commit 32a88c1

File tree

1 file changed

+9
-6
lines changed
  • pages/api/webhooks/services/[...path]

1 file changed

+9
-6
lines changed

pages/api/webhooks/services/[...path]/index.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ async function handleDocumentCreate(
468468
const hashedPassword = link.password
469469
? await generateEncrpytedPassword(link.password)
470470
: preset?.password
471-
? preset.password
471+
? await generateEncrpytedPassword(preset.password)
472472
: null;
473473

474474
const expiresAtDate = link.expiresAt
@@ -505,7 +505,8 @@ async function handleDocumentCreate(
505505
emailAuthenticated:
506506
link.emailAuthenticated || preset?.emailAuthenticated || false,
507507
allowDownload: link.allowDownload || preset?.allowDownload,
508-
enableNotification: link.enableNotification ?? preset?.enableNotification ?? false,
508+
enableNotification:
509+
link.enableNotification ?? preset?.enableNotification ?? false,
509510
enableFeedback: link.enableFeedback,
510511
enableScreenshotProtection: link.enableScreenshotProtection,
511512
showBanner: link.showBanner ?? preset?.showBanner ?? false,
@@ -708,7 +709,7 @@ async function handleLinkCreate(
708709
const hashedPassword = link.password
709710
? await generateEncrpytedPassword(link.password)
710711
: preset?.password
711-
? preset.password
712+
? await generateEncrpytedPassword(preset.password)
712713
: null;
713714

714715
const expiresAtDate = link.expiresAt
@@ -735,7 +736,8 @@ async function handleLinkCreate(
735736
emailAuthenticated:
736737
link.emailAuthenticated || preset?.emailAuthenticated || false,
737738
allowDownload: link.allowDownload || preset?.allowDownload,
738-
enableNotification: link.enableNotification ?? preset?.enableNotification ?? false,
739+
enableNotification:
740+
link.enableNotification ?? preset?.enableNotification ?? false,
739741
enableFeedback: link.enableFeedback,
740742
enableScreenshotProtection: link.enableScreenshotProtection,
741743
showBanner: link.showBanner ?? preset?.showBanner ?? false,
@@ -927,7 +929,7 @@ async function handleDataroomCreate(
927929
const hashedPassword = link.password
928930
? await generateEncrpytedPassword(link.password)
929931
: preset?.password
930-
? preset?.password
932+
? await generateEncrpytedPassword(preset.password)
931933
: null;
932934
const expiresAtDate = link.expiresAt
933935
? new Date(link.expiresAt)
@@ -950,7 +952,8 @@ async function handleDataroomCreate(
950952
emailAuthenticated:
951953
link.emailAuthenticated || preset?.emailAuthenticated || false,
952954
allowDownload: link.allowDownload || preset?.allowDownload,
953-
enableNotification: link.enableNotification ?? preset?.enableNotification ?? false,
955+
enableNotification:
956+
link.enableNotification ?? preset?.enableNotification ?? false,
954957
enableFeedback: link.enableFeedback,
955958
enableScreenshotProtection: link.enableScreenshotProtection,
956959
showBanner: link.showBanner ?? preset?.showBanner ?? false,

0 commit comments

Comments
 (0)