wip3
This commit is contained in:
parent
737648359d
commit
53a1a3fad1
@ -21,8 +21,16 @@ security:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
oauth_token:
|
||||
pattern: ^/oauth/(token|authorize)$
|
||||
pattern: ^/oauth/token$
|
||||
security: false
|
||||
oauth_authorize:
|
||||
pattern: ^/oauth/authorize$
|
||||
security: true
|
||||
entry_point: App\Security\Authenticator
|
||||
guard:
|
||||
authenticators:
|
||||
- App\Security\Authenticator
|
||||
provider: local_user
|
||||
oauth:
|
||||
guard:
|
||||
authenticators:
|
||||
|
@ -81,6 +81,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use SymfonyCasts\Bundle\ResetPassword\ResetPasswordHelperInterface;
|
||||
use SymfonyCasts\Bundle\VerifyEmail\VerifyEmailHelperInterface;
|
||||
use Trikoder\Bundle\OAuth2Bundle\Event\UserResolveEvent;
|
||||
use Trikoder\Bundle\OAuth2Bundle\OAuth2Events;
|
||||
use Twig\Environment;
|
||||
|
||||
/**
|
||||
@ -292,9 +293,9 @@ class GNUsocial implements EventSubscriberInterface
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
KernelEvents::REQUEST => 'onKernelRequest',
|
||||
'console.command' => 'onCommand',
|
||||
'trikoder.oauth2.user_resolve' => 'userResolve',
|
||||
KernelEvents::REQUEST => 'onKernelRequest',
|
||||
'console.command' => 'onCommand',
|
||||
OAuth2Events::USER_RESOLVE => 'userResolve',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,8 @@ class Authenticator extends AbstractFormLoginAuthenticator implements Authentica
|
||||
|
||||
public function supports(Request $request): bool
|
||||
{
|
||||
return self::LOGIN_ROUTE === $request->attributes->get('_route') && $request->isMethod('POST');
|
||||
return (self::LOGIN_ROUTE === $request->attributes->get('_route') && $request->isMethod('POST'))
|
||||
|| ('oauth2_authorize' === $request->attributes->get('_route'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user