You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#config/packages/security.yaml
providers:
# used to reload user from session & other features (e.g. switch_user)
app_employee_provider:
entity:
class: App\Entity\Employee
property: mobile
# used to reload user from session & other features (e.g. switch_user)
app_company_provider:
entity:
class: App\Entity\Company
property: societyCode
chain_provider:
chain:
providers: ['app_employee_provider','app_company_provider']
firewalls:
api:
pattern: ^/api
stateless: true
provider: chain_provider
jwt: ~
#[Route('/test')]
public function formRender(EntityManagerInterface $em, JWTTokenManagerInterface $tokenManager,AuthenticationSuccessHandler $authenticationSuccessHandler)
{
$user = $em->getRepository(Company::class)->findOneBy(['societyCode'=>123456789]);
return $authenticationSuccessHandler->handleAuthenticationSuccess($user);
}
if the employee user mobile is 123456789 too. when i request api router i will get employee user not company user,how to fix it
The text was updated successfully, but these errors were encountered:
symfony 6.3
if the employee user mobile is 123456789 too. when i request api router i will get employee user not company user,how to fix it
The text was updated successfully, but these errors were encountered: