-
-
Notifications
You must be signed in to change notification settings - Fork 364
doc(MFA): add MFA sample code #5975
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
Conversation
Reviewer's GuideThis pull request introduces a Multi-Factor Authentication (MFA) sample by adding new Razor components ( Sequence Diagram for Two-Factor App VerificationsequenceDiagram
actor User
participant TwoFactorApp
participant TotpService
participant ToastService
User->>TwoFactorApp: Enters OTP code
User->>TwoFactorApp: Clicks "Sign in" button
TwoFactorApp->>TotpService: Verify(code)
alt Verification Success
TotpService-->>TwoFactorApp: true
TwoFactorApp->>ToastService: Success("Sign In", "Login success...")
ToastService-->>User: Show Success Toast
else Verification Failure
TotpService-->>TwoFactorApp: false
TwoFactorApp->>ToastService: Error("Sign In", "Login failed.")
ToastService-->>User: Show Error Toast
end
Class Diagram for New MFA ComponentsclassDiagram
direction LR
class Login {
+NavigationManager NavigationManager
+OnSubmit()
}
note for Login "Navigates to /tutorials/mfa/two-factor"
class TwoFactor {
+IOptionsMonitor<WebsiteOptions> WebsiteOption
}
note for TwoFactor "Displays MFA options, links to /tutorials/mfa/two-factor/app"
class TwoFactorApp {
+ITotpService TotpService
+ToastService ToastService
-string _code
+OnVerify()
}
note for TwoFactorApp "Verifies OTP code using TotpService"
Login ..> NavigationManager : Uses
TwoFactor ..> IOptionsMonitor : Uses
TwoFactorApp ..> ITotpService : Uses
TwoFactorApp ..> ToastService : Uses
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ArgoZhang - I've reviewed your changes - here's some feedback:
- The sample login page uses hardcoded credentials; consider clarifying in the code or UI that these are for demonstration purposes.
- Consider consolidating common CSS styles, such as
.bb-sign-bodyand.bb-sign-callout, across the new MFA pages to improve maintainability.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟡 Security: 1 issue found
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
src/BootstrapBlazor.Server/Components/Samples/Tutorials/MFA/TwoFactor.razor
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5975 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 670 670
Lines 30606 30606
Branches 4352 4352
=========================================
Hits 30606 30606 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Link issues
fixes #5974
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add Multi-Factor Authentication (MFA) sample code and tutorial pages to the BootstrapBlazor project
New Features:
Enhancements:
Documentation: