Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ jobs:

- name: Type-check
run: npm run type-check

- name: Test
run: npm test
5 changes: 4 additions & 1 deletion example/src/pages/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { AuthorizerMFASetup, useAuthorizer } from 'authorizer-react';
// configured email/SMS provider) and this page reflects it automatically on
// next load, with no code change here.
const Settings: React.FC = () => {
const { config } = useAuthorizer();
const { config, user } = useAuthorizer();

return (
<div>
Expand All @@ -21,6 +21,9 @@ const Settings: React.FC = () => {
emailOtp: config.is_email_otp_mfa_enabled,
smsOtp: config.is_sms_otp_mfa_enabled,
}}
// What this user already enrolled, so those tiles read
// "Enabled"/"Manage" instead of offering a fresh setup.
enrolledMethods={user?.enrolled_mfa_methods}
heading="Add a second step to sign in"
/>
<br />
Expand Down
Loading
Loading