Skip to content

Conversation

zachgilbert97
Copy link
Contributor

@zachgilbert97 zachgilbert97 commented Sep 26, 2025

Description:

  • Currently the WorkOS Laravel integration expects the App\Models\User to represent a user, but some applications may use a different model.
  • Through the Laravel config you typically define an alternative user model, under auth.providers.users.model (defaulting to \App\User\Model or reading from AUTH_MODEL in the .env)
  • As such, the AuthKitAuthenticationRequest here is updated to take the model from config, and typed to expect a model implementing the Authenticatable contract
  • This makes the dependency more versatile to Laravel applications that do not use the convention of \App\Models\User being the user model.
  • Existing Laravel applications which do use the \App\Models\User as the user model will not break, assuming they implement the Authenticatable contract.

Tests:

   PASS  Tests\Unit\UnitTest
  ✓ it is true                                                                                                             0.02s

   PASS  Tests\Feature\AuthKitLoginRequestTest
  ✓ it redirects to WorkOS without screen hint                                                                             0.26s
  ✓ it redirects to WorkOS with sign-in screen hint                                                                        0.01s
  ✓ it redirects to WorkOS with sign-up screen hint                                                                        0.01s
  ✓ it stores state in session                                                                                             0.01s
  ✓ it includes state in the authorization URL                                                                             0.01s
  ✓ it passes all parameters correctly to getAuthorizationUrl                                                              0.05s
  ✓ it supports domain hint parameter                                                                                      0.01s
  ✓ it supports login hint parameter                                                                                       0.02s
  ✓ it uses default redirect URL when not specified                                                                        0.03s
  ✓ it uses custom redirect URL when specified                                                                             0.01s
  ✓ it supports multiple parameters at once                                                                                0.01s

   PASS  Tests\Feature\FeatureTest
  ✓ example                                                                                                                0.02s

  Tests:    13 passed (39 assertions)
  Duration: 0.66s

@taylorotwell taylorotwell merged commit f64d86d into laravel:main Sep 26, 2025
7 checks passed
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