Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add panel option to customize auth routes #13454

Open
juliangums opened this issue Jul 2, 2024 · 5 comments
Open

Add panel option to customize auth routes #13454

juliangums opened this issue Jul 2, 2024 · 5 comments
Labels
Milestone

Comments

@juliangums
Copy link
Contributor

juliangums commented Jul 2, 2024

Package

filament/filament

Package Version

latest

Laravel Version

latest

Livewire Version

latest

PHP Version

latest

Problem description

The issue is outlined in these two discussions:
#11705
#13431

If I have multiple panels sharing the same login, I need to be able to set a login redirect URL on the panels that don't have their own login.

Expected behavior

We need to have an option to specify the login redirect route of another panel.

Steps to reproduce

  1. Clone the repos
  2. Migrate and seed the database
  3. Open the app and log in with [email protected] and admin.
  4. You are in the noteam panel. Logging out from here will work. But if you navigate to the team panel by replacing noteam with team in the URL, and you try to log out, you will be redirected to the generic login route which does not exist.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/juliangums/filament-multi-panel-auth-test

Relevant log output

No response

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar
Copy link

github-actions bot commented Jul 2, 2024

Hey @juliangums! We're sorry to hear that you've hit this issue. 💛

However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?

We need a public GitHub repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.

Also, it doesn't look like you've provided much information on how to replicate the issue. Please edit your original post with clear steps we need to take.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Roadmap Jul 2, 2024
@danharrin
Copy link
Member

Can you please reproduce the redirect issue and write a few steps as to how to get there

Copy link

github-actions bot commented Jul 5, 2024

Thank you for providing reproduction steps! Reopening the issue now.

@github-actions github-actions bot reopened this Jul 5, 2024
@github-project-automation github-project-automation bot moved this from Done to Todo in Roadmap Jul 5, 2024
@juliangums
Copy link
Contributor Author

@danharrin updated this with a repo and instructions.

@juliangums
Copy link
Contributor Author

Basically if I extend the Panel and override this method from HasAuth

    public function getLoginUrl(array $parameters = []): ?string
    {
        if (! $this->hasLogin()) {
            return null;
        }

        return $this->route('auth.login', $parameters);
    }

I can get the desired outcome. I will do that for now, but it might be an option to create a setter, so people can override it without extending Panel.

@zepfietje zepfietje added this to the v3 milestone Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

3 participants