Two-Factor Authentication (2FA)
Peak provides robust security features out of the box, including built-in support for Two-Factor Authentication (2FA) powered by Laravel Jetstream and Laravel Fortify. With 2FA enabled, your users can secure their accounts with time-based one-time passwords (TOTP), adding a second layer of protection beyond just email and password.
Two-Factor Authentication Support in Peakβ
By default, 2FA is supported and integrated into every Peak installation.
Users can enable 2FA directly from their Account Settings β Security panel. Once enabled, their login flow will require a 6-digit code from an authenticator app in addition to their password.
Enabling 2FA (User Instructions)β
When a user enables two-factor authentication:
-
A QR code is presented for scanning using any TOTP-compatible app such as:
- Google Authenticator
- Authy
- 1Password
- Microsoft Authenticator
-
A list of recovery codes is also displayed. Users should copy these codes and store them in a secure password manager. These recovery codes serve as a backup if the user loses access to their mobile device.
Note: Users should treat these recovery codes as confidential. If lost, they will need to disable and re-enable 2FA to generate new ones.
Logging In with 2FAβ
After enabling 2FA, the login process changes slightly:
- After providing email and password, users will be prompted for a TOTP code from their authenticator app.
- If the user no longer has access to their device, they can use one of their previously saved recovery codes to gain access.
Disabling Two-Factor Authenticationβ
To disable 2FA functionality across your application:
Admin Panel β Settings β Security β Two-Factor Authentication β Disable
This will:
- Hide 2FA settings from user accounts
- Prevent users from enabling 2FA
Actionsβ
For security, Jetstreamβs 2FA implementation is encapsulated and does not require customization.
All enabling, disabling, and challenge processes are handled via Jetstream's Fortify configuration and middleware layers. This ensures consistent, secure behavior.
Views / Pagesβ
While customization is generally not needed, you may tweak presentation or styles in the following Vue components:
Feature | File |
---|---|
Two-Factor Setup UI | resources/js/Themes/Breeze/Pages/Dashboard/Partials/TwoFactorAuthenticationForm.vue |
Two-Factor Login Challenge | resources/js/Themes/Breeze/Pages/Auth/TwoFactorChallenge.vue |
If you adjust these components, make sure to recompile your frontend assets:
npm run dev
Summaryβ
- β 2FA is supported in Peak by default
- π± Uses TOTP (Google Authenticator, 1Password, etc.)
- π Offers backup recovery codes for emergencies
- π Login is secured via Fortify middleware and challenge
- βοΈ 2FA can be globally disabled in Admin Settings