Skip to content

feat(examples): add full customization demo to the angular example - #1540

Open
demolaf wants to merge 1 commit into
feat/shadcn-customization-demofrom
feat/angular-customization-demo
Open

demolaf wants to merge 1 commit into
feat/shadcn-customization-demofrom
feat/angular-customization-demo

Conversation

@demolaf

@demolaf demolaf commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Adds the full customization demo to the Angular example as a lazy /full-customization route, ported from the React demo with the same flows, copy and four themes. Stacked on #1539, which it depends on.

Changes

  • Screens are standalone components on @firebase-oss/ui-core functions, using injectUI, injectRecaptchaVerifier and the schema and country injectables from @firebase-oss/ui-angular.
  • Reauthentication with MFA runs in a dialog that calls firebase/auth directly, since ui-angular has no reauth API.
  • The MFA resolver cleanup sits on a host that outlives the theme, so switching theme mid-challenge keeps the sign in.
  • The demo CSS loads as a lazy style bundle and the global toggles hide on this route, so the rest of the example is unchanged.
  • TOTP setup is not covered by the previews, as the Auth emulator does not support TOTP.

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment on lines +303 to +309
onClick={() =>
navigator.clipboard.writeText(secret.secretKey).then(
() => setCopied(true),
// Clipboard access can be denied; the key is still selectable.
() => setCopied(false)
)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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)
              );
            }}

Comment on lines +304 to +310
onClick={() =>
navigator.clipboard.writeText(secret.secretKey).then(
() => setCopied(true),
// Clipboard access can be denied; the key is still selectable.
() => setCopied(false)
)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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)
              );
            }}

@demolaf
demolaf marked this pull request as draft November 13, 2026 13:56
@demolaf
demolaf changed the base branch from main to feat/shadcn-customization-demo November 13, 2026 14:31
@demolaf
demolaf added this pull request to stack #1541 November 13, 2026 14:31
@demolaf
demolaf force-pushed the feat/angular-customization-demo branch from 02291c0 to b74d6d5 Compare November 18, 2026 12:38
@demolaf
demolaf marked this pull request as ready for review November 18, 2026 12:41

@russellwheatley russellwheatley left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants