Skip to content

fix: use team slug instead of ULID for tenant URL resolution#127

Merged
ManukMinasyan merged 1 commit intomainfrom
fix/login-redirect-uses-slug
Feb 16, 2026
Merged

fix: use team slug instead of ULID for tenant URL resolution#127
ManukMinasyan merged 1 commit intomainfrom
fix/login-redirect-uses-slug

Conversation

@ManukMinasyan
Copy link
Copy Markdown
Contributor

Summary

  • LoginResponse: Pass the team model instead of ->getKey() (ULID) when building the post-login redirect URL, so Filament resolves the slug attribute correctly
  • AppPanelProvider: Developer login link redirect-url changed from url('/') (marketing homepage) to url()->getAppUrl() (app panel)
  • AuthenticationTest: Fix assertion to use $team->slug instead of $team->id

Root cause

The app panel is configured with slugAttribute: 'slug' for tenant routing, but LoginResponse was passing $user->currentTeam->getKey() (the ULID primary key) as the tenant parameter. Filament generated a URL with the ULID, then tried to resolve it against the slug column — resulting in a 404.

Test plan

  • All 686 tests passing
  • Login with email/password redirects to /app/{team-slug}/companies
  • Developer login link (local env) redirects to app panel

Login redirect was building URLs with the team's ULID primary key
instead of the slug attribute, causing 404s after authentication.
Also fix developer login link redirect to use app panel URL.
Copilot AI review requested due to automatic review settings February 16, 2026 04:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a critical bug in tenant URL resolution where the app was using ULID primary keys instead of team slugs for routing, causing 404 errors after login. The fix ensures that Filament's tenant routing correctly uses the configured slugAttribute: 'slug' by passing the Team model instead of its ULID key.

Changes:

  • Fixed LoginResponse to pass the Team model (not ULID) to Filament's URL generation for proper slug resolution
  • Updated developer login link to redirect to the app panel instead of the marketing homepage
  • Corrected test assertion to validate slug-based URLs instead of ULID-based URLs

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
app/Http/Responses/LoginResponse.php Pass Team model instead of ULID to enable Filament slug resolution
app/Providers/Filament/AppPanelProvider.php Fix developer login redirect URL to point to app panel
tests/Feature/Auth/AuthenticationTest.php Update test to assert slug-based URL instead of ULID-based URL

@ManukMinasyan ManukMinasyan merged commit 7139b95 into main Feb 16, 2026
15 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