Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive 'Full Customization Demo' across the Angular, React, and Shadcn examples, showcasing a complete custom sign-in flow with multi-factor authentication (MFA) enrollment and challenges, password resets, and guest access. The feedback highlights a potential runtime crash across all three framework implementations (Angular, React, and Shadcn) on the MFA enrollment screens, where 'navigator.clipboard' is accessed directly to copy the TOTP secret key without verifying if the API is available (e.g., in non-secure HTTP contexts or older browsers).
| onClick={() => | ||
| navigator.clipboard.writeText(secret.secretKey).then( | ||
| () => setCopied(true), | ||
| // Clipboard access can be denied; the key is still selectable. | ||
| () => setCopied(false) | ||
| ) | ||
| } |
There was a problem hiding this comment.
The navigator.clipboard API is only available in secure contexts (HTTPS) and supported browsers. Accessing it directly without a check can cause a runtime TypeError when running the demo in non-secure environments or older browsers. Adding a guard check prevents potential crashes.
onClick={() => {
if (!navigator.clipboard) {
setCopied(false);
return;
}
navigator.clipboard.writeText(secret.secretKey).then(
() => setCopied(true),
// Clipboard access can be denied; the key is still selectable.
() => setCopied(false)
);
}}
| onClick={() => | ||
| navigator.clipboard.writeText(secret.secretKey).then( | ||
| () => setCopied(true), | ||
| // Clipboard access can be denied; the key is still selectable. | ||
| () => setCopied(false) | ||
| ) | ||
| } |
There was a problem hiding this comment.
The navigator.clipboard API is only available in secure contexts (HTTPS) and supported browsers. Accessing it directly without a check can cause a runtime TypeError when running the demo in non-secure environments or older browsers. Adding a guard check prevents potential crashes.
onClick={() => {
if (!navigator.clipboard) {
setCopied(false);
return;
}
navigator.clipboard.writeText(secret.secretKey).then(
() => setCopied(true),
// Clipboard access can be denied; the key is still selectable.
() => setCopied(false)
);
}}
02291c0 to
b74d6d5
Compare
Adds the full customization demo to the Angular example as a lazy
/full-customizationroute, ported from the React demo with the same flows, copy and four themes. Stacked on #1539, which it depends on.Changes
@firebase-oss/ui-corefunctions, usinginjectUI,injectRecaptchaVerifierand the schema and country injectables from@firebase-oss/ui-angular.firebase/authdirectly, since ui-angular has no reauth API.Preview
Email sign in (Doggo)
angular-customization-email-sign-in.mp4
Sign up with the password mismatch hint (Grid)
angular-customization-sign-up.mp4
Phone sign in with an SMS code (Coffee Spark)
angular-customization-phone.mp4
MFA challenge, switching theme mid-challenge (Doggo to Professional)
angular-customization-mfa-challenge-theme-switch.mp4
Reauthentication with MFA in the dialog (Professional)
angular-customization-reauth-with-mfa.mp4
MFA enrollment and two-step remove (Professional)
angular-customization-mfa-enrollment.mp4
Password reset and email link sign in (Professional)
angular-customization-reset-and-email-link.mp4
Maintainer note: Fixes internal CPRN-662