Skip to content

Conversation

@Boy132
Copy link
Member

@Boy132 Boy132 commented Jul 8, 2025

Otherwise you sometimes get 403 invalid signature errors. Just a small refactor.

@Boy132 Boy132 self-assigned this Jul 8, 2025
@Boy132 Boy132 marked this pull request as ready for review July 8, 2025 07:52
@Boy132 Boy132 changed the title Use filaments password broker for reset link token Use filaments password broker for reset link token when creating subuser Jul 8, 2025
@Boy132 Boy132 requested a review from Copilot July 8, 2025 08:10
Copy link

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 PR updates the subuser creation flow to use Filament’s configured password broker for reset token generation, addressing intermittent 403 invalid signature errors.

  • Removed the injected PasswordBroker dependency
  • Added the Filament and Password facades to resolve the correct broker at runtime
  • Changed token creation to use Password::broker(Filament::getPanel('app')->getAuthPasswordBroker())
Comments suppressed due to low confidence (2)

app/Services/Users/UserCreationService.php:19

  • Removing the PasswordBroker injection alters the constructor signature and could break any consumers relying on dependency injection. Consider updating the service binding or bumping the version to signal this breaking change.
        private readonly Hasher $hasher,

app/Services/Users/UserCreationService.php:56

  • The new branch using the Filament password broker should be covered by tests to verify correct token generation and avoid future regressions.
            $broker = Password::broker(Filament::getPanel('app')->getAuthPasswordBroker());

Copy link
Member

@rmartinoscar rmartinoscar left a comment

Choose a reason for hiding this comment

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

Filament::getPanel('app')->getAuthPasswordBroker() will always return null since we don't override it with https://filamentphp.com/docs/3.x/panels/users#setting-the-password-broker
So it will always default to laravel's broker 🤔

Like i said the only time i had encountered this issue was when APP_URL was wrong either no https while it was served over SSL or trailing slash

Copy link
Member

@notAreYouScared notAreYouScared left a comment

Choose a reason for hiding this comment

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

I don't use the emails, but if this fixes it 👍

@Boy132
Copy link
Member Author

Boy132 commented Jul 19, 2025

So, turns out the 403 errors are a problem with url encoding. While this PR does not fix that it's still a nice little refactor.

@Boy132 Boy132 merged commit 9f2305f into main Jul 19, 2025
25 checks passed
@Boy132 Boy132 deleted the boy132/fix-password-reset-link branch July 19, 2025 16:51
@github-actions github-actions bot locked and limited conversation to collaborators Jul 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants