Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow sms mfa to be toggled on and off #637

Merged
merged 2 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
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