Expand description
Laravel Fortify for Laravel Rust: a frontend agnostic authentication backend.
A community port of Laravel Fortify by Rivervo. See the README for installation and usage.
Modules§
- actions
- Fortify’s actions:
Laravel\Fortify\Actions. - contracts
- The actions an application implements, and the services it may replace:
Laravel\Fortify\Contracts. - events
- The events Fortify dispatches:
Laravel\Fortify\Events, and the framework’s authentication events that Fortify fires (Illuminate\Auth\Events), which Laravel Rust doesn’t have. - http
- Fortify’s routes’ handlers:
Laravel\Fortify\Http\Controllers, one module per controller. - input
- Reading request input by a field name that the configuration chooses, such as
Fortify::username(), as PHP’s$request->input($name)does. - rules
Laravel\Fortify\Rules\Password: Fortify’s own password rule, deprecated in PHP in favour of Laravel’sPasswordrule (laravel::validation::Rule::password), and kept for parity.
Structs§
- Features
- Checks which features the application enables:
Laravel\Fortify\Features. - Fortify
- Fortify’s helpers:
Laravel\Fortify\Fortify. - Fortify
Config - Fortify’s settings, with the defaults of the package’s
config/fortify.php. - Fortify
Service Provider - Registers Fortify’s configuration, migration, and routes, and holds the application’s
customizations: PHP’s
FortifyServiceProviderand theFortify::*()calls of the publishedApp\Providers\FortifyServiceProvider. - Limiters
- The rate limiters of Fortify’s routes:
fortify.limiters. - Login
Next - The rest of the login pipeline, which ends with the login response.
- Login
Rate Limiter - Throttles failed logins: five a minute for each username and IP address:
Laravel\Fortify\LoginRateLimiter. - Login
Request - The login request that passes through the login pipeline:
Laravel\Fortify\Http\Requests\LoginRequest. - Misconfigured
- A misconfiguration that Fortify reports as a server error, such as a view that the application didn’t give: the PHP container’s “target is not instantiable” exceptions.
- Passkey
Options - The options of
Feature::Passkeys: the array passed toFeatures::passkeys(). - Passkey
Paths fortify.paths.passkey.- Passkeys
Config - The passkey settings:
fortify.passkeys. - Passkeys
Service Provider Laravel\Fortify\PasskeyAuthenticatableand the passkeys provider, from laravel-passkey. Registers the package’s configuration, thepasskeysmigration, and the passkey routes for the user modelU.- Password
Paths fortify.paths.password.- Paths
- Custom paths of Fortify’s routes, keyed like
fortify.paths.Nonekeeps Fortify’s path. - Recovery
Code - Generates recovery codes:
Laravel\Fortify\RecoveryCode. - Redirects
- Custom redirects after Fortify’s actions:
fortify.redirects.Nonefalls back toFortifyConfig::home(or the action’s own default). - Require
Password - Requires a recent password confirmation: Laravel’s
password.confirmmiddleware (Illuminate\Auth\Middleware\RequirePassword), which Laravel Rust doesn’t have. - Response
Context - What a response knows besides the request, as the PHP responses’ constructor arguments.
- TwoFactor
Authentication Provider - The default two-factor provider: time-based one-time passwords (RFC 6238) with SHA-1, six
digits, and 30-second steps, as Google Authenticator and PHP’s
pragmarx/google2fause them:Laravel\Fortify\TwoFactorAuthenticationProvider. - TwoFactor
Options - The options of
Feature::TwoFactorAuthentication: the array passed toFeatures::twoFactorAuthentication(). - TwoFactor
Paths fortify.paths.two-factor.- Update
Path fortify.paths.user-profile-informationandfortify.paths.user-password.- Verification
Paths fortify.paths.verification.
Enums§
- Feature
- A feature that Fortify can enable, listed in
FortifyConfig::features. - Response
Kind - The response contracts that an application may replace, one per
Laravel\Fortify\Contracts\*Responseinterface that Fortify’s service provider binds. - View
Kind - The views that Fortify’s
GETroutes return, one per*ViewResponsecontract.
Traits§
- Login
Step - One pipe of the login pipeline, such as
AttemptToAuthenticate: a class with ahandle($request, $next)method in PHP. - Passkey
Authenticatable Laravel\Fortify\PasskeyAuthenticatableand the passkeys provider, from laravel-passkey. A user who can register passkeys and log in with them.- TwoFactor
Authenticatable - A user who can enable two-factor authentication: the
TwoFactorAuthenticatabletrait.
Functions§
- ensure_
two_ factor_ state_ is_ valid - Keeps the session’s two-factor state valid and handles its transitions:
ensureStateIsValid(). Call it on each render of the page that enables two-factor authentication. When confirmation is on and the user left the page without confirming a setup they began, the setup is disabled. - pages
- Marks Fortify’s pages for Laravel’s authentication: the login page (where
Authenticatesends guests) and the reset password page (which reset emails link to), when Fortify registers their views. Call it inwith_auth, as PHP’sroute('login')androute('password.reset')find Fortify’s routes by name. - verification_
pages - Marks Fortify’s email verification pages: the verification notice (where
RequireVerifiedEmailsends unverified users) and the route that verification emails link to. Call it inwith_authwithpageswhenUderivesMustVerifyEmail.