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

Front-end 2FA #16344

Merged
merged 12 commits into from
Dec 22, 2024
Merged

Front-end 2FA #16344

merged 12 commits into from
Dec 22, 2024

Conversation

brandonkelly
Copy link
Member

@brandonkelly brandonkelly commented Dec 19, 2024

Description

Exposes the system’s login form on the front end via /login (or whatever loginPath is set to), as a fallback if a custom login template at the same path doesn’t exist, complete with 2FA and passkey support.

Sites with custom login templates get 2FA support as well: when a user who requires 2FA submits a custom login form, the users/login action will now redirect them to /login?verify=1, which will render the 2FA verification form.

Additionally, system templates are now styled a bit more generically when rendered on the front end, and the styles can be overridden via a new systemTemplateCss config setting.

// config/general.php

return GeneralConfig::create()
    ->systemTemplateCss('/css/cp-theme.css')
;
/* web/css/cp-theme.css */

:root {
    --primary-button-bg: #2563eb;
    --primary-button-bg--hover: #1d4ed8;
    --primary-button-bg--active: #1e40af;
}

Tip

See src/web/assets/theme/dist/fe.css for a full list of properties that can be overridden.

The system Set Password template, rendered on the front end

The system Login template, rendered on the front end

The system 2FA Setup template, rendered on the front end

To do

  • Simplify the styling for system login & set-password templates when rendered on the front end
  • Add support for theming system templates on the front end with CSS variables
  • Support rendering the login & set-password templates on the “front end” (requests that aren’t explicitly for the control panel) when in headless mode.

Related issues

Copy link

linear bot commented Dec 19, 2024

CMS-1350 Front end 2FA

@brandonkelly brandonkelly changed the title Initial work on front-end 2FA Front-end 2FA Dec 19, 2024
@brandonkelly brandonkelly marked this pull request as ready for review December 22, 2024 23:58
@brandonkelly brandonkelly merged commit ddd41a5 into 5.6 Dec 22, 2024
@brandonkelly brandonkelly deleted the feature/cms-1350-front-end-2fa branch December 22, 2024 23:58
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.

1 participant