Skip to content

Conversation

husam-tariq
Copy link
Contributor

Adding any additional middleware you want to apply to the logout and login route using config

//rupadana/filament-api-service/routes/api.php

 $router->post('/auth/login', [AuthController::class, 'login'])->middleware(config('api-service.login-middleware', []));
 $router->post('/auth/logout', [AuthController::class, 'logout'])->middleware(config('api-service.logout-middleware', ['auth:sanctum']));

//rupadana/filament-api-service/config/api-service.php

  'login-middleware' => [
        // Add any additional middleware you want to apply to the login route
    ],
    'logout-middleware' => [
        'auth:sanctum',
        // Add any additional middleware you want to apply to the logout route
    ],

@husam-tariq
Copy link
Contributor Author

@rupadana can you merge it please? i need this feature because i'm using stancl/tenancy and it’s requires custom middleware like InitializeTenancyByDomain::class

@rupadana
Copy link
Owner

@husam-tariq i see you write login-rules on the README.md but never used on any code, Please check it first.

Screenshot 2025-07-12 at 08 50 29

@husam-tariq
Copy link
Contributor Author

husam-tariq commented Jul 15, 2025

Hi @rupadana and thanks for your response

it's already exist in the Rupadana\ApiService\Http\Requests\LoginRequest

I though you just forgot to add it in the README.md

image

@rupadana
Copy link
Owner

i see...

@rupadana rupadana merged commit cc3918f into rupadana:main Jul 17, 2025
14 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