Skip to content

Commit

Permalink
fix: allow sms mfa to be toggled on and off (#3636)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludtkemorgan authored Sep 5, 2023
1 parent 01d06ae commit 92add25
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions sites/partners/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ CLOUDINARY_KEY='abcxyz'
CLOUDINARY_SIGNED_PRESET='test123'
MAPBOX_TOKEN=
FEATURE_LISTINGS_APPROVAL=FALSE
SHOW_SMS_MFA=TRUE
1 change: 1 addition & 0 deletions sites/partners/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module.exports = withBundleAnalyzer(
listingServiceUrl: BACKEND_API_BASE + LISTINGS_QUERY,
idleTimeout: process.env.IDLE_TIMEOUT,
showDuplicates: process.env.SHOW_DUPLICATES === "TRUE",
showSmsMfa: (process.env.SHOW_SMS_MFA || "TRUE") === "TRUE", // SMS on by default
cloudinaryCloudName: process.env.CLOUDINARY_CLOUD_NAME,
cloudinaryKey: process.env.CLOUDINARY_KEY,
cloudinarySignedPreset: process.env.CLOUDINARY_SIGNED_PRESET,
Expand Down
28 changes: 16 additions & 12 deletions sites/partners/src/components/users/FormSignInMFAType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ const FormSignInMFAType = ({
<h2 className="form-card__title is-borderless">
{t("nav.signInMFA.verificationChoiceMainTitle")}
</h2>
<p className="form-card__sub-title">
{t("nav.signInMFA.verificationChoiceSecondaryTitle")}
</p>
{process.env.showSmsMfa && (
<p className="form-card__sub-title">
{t("nav.signInMFA.verificationChoiceSecondaryTitle")}
</p>
)}
</div>
<FormSignInErrorBox
errors={errors}
Expand Down Expand Up @@ -80,15 +82,17 @@ const FormSignInMFAType = ({
{t("nav.signInMFA.verifyByEmail")}
</Button>
</div>
<div className="text-center mt-6">
<Button
styleType={AppearanceStyleType.accentCool}
data-testid="verify-by-phone"
onClick={smsOnClick}
>
{t("nav.signInMFA.verifyByPhone")}
</Button>
</div>
{process.env.showSmsMfa && (
<div className="text-center mt-6">
<Button
styleType={AppearanceStyleType.accentCool}
data-testid="verify-by-phone"
onClick={smsOnClick}
>
{t("nav.signInMFA.verifyByPhone")}
</Button>
</div>
)}
</Form>
</div>
</FormCard>
Expand Down

0 comments on commit 92add25

Please sign in to comment.