jtargosz/laravel-action-otp
jtargosz/laravel-action-otp is a Laravel package for one-time password workflows, offering action-based helpers to generate, send, and verify OTP codes. It fits Laravel's action pattern for clean, reusable authentication and verification flows.
ActionOtp::identifyUsing() addition makes identifier selection a server-side decision for verify and resend. This supports launching OTP login by email, phone, or account ID without trusting a client-supplied field, and lets a resolver return null to answer empty without consuming a rate-limit attempt — useful for anti-enumeration and abuse-control requirements.ConfirmSession change clarifies that session confirmation is the package controllers' responsibility, not a global request concern. This informs architecture decisions about whether OTP confirmation is used only inside package routes or also as a reusable primitive in custom flows (e.g., sensitive-action confirmation, password reset, invite acceptance).ActionOtpFake cleanup reduces test-harness friction, supporting decisions to standardize OTP-dependent feature tests on the package's fake rather than bespoke mocks.ConfirmSession behavior change is a migration item for any team that verified sessions manually outside package routes; this affects release sequencing for dependent services.Adopt when:
identifyUsing() resolver returning null).ActionOtpFake.Look elsewhere or build custom when:
ConfirmSession verification outside package routes without managing SESSION_KEY; v2.1.0 shifts that responsibility to the caller, so plan for it or stay on the prior version until migrated.For executives: This package covers the standard one-time-password and magic-link flows so we can ship passwordless login and step-up verification without building and maintaining authentication plumbing. The v2.1.0 release strengthens abuse resistance by letting the server choose which identifier is verified and by making "no such account" answers not consume an attempt. It also improves localization for Polish and German. One change requires a small migration: code that confirmed sessions manually outside the package's routes must now set the session key itself.
For engineering: v2.1.0 adds ActionOtp::identifyUsing() for server-side identifier resolution on verify and resend — the request field is ignored, and a null resolver returns empty without counting an attempt. ValidOtpCode now fails validation on a blank purpose rather than throwing. otp.confirm sets the session inside package controllers (code, magic link, verify) instead of via global request() in ConfirmSession::handle(), so manual ConfirmSession verification no longer implicitly needs a session but must set ConfirmSession::SESSION_KEY explicitly. Also includes translation rewording and removal of an unused Recorder argument from ActionOtpFake. Treat the ConfirmSession change as the migration item; everything else is additive or internal.
How can I help you explore Laravel packages today?