OAuthBundle\Services\AuthenticationSuccessHandler::onAuthenticationSuccess PHP Method

onAuthenticationSuccess() public method

public onAuthenticationSuccess ( Request $request, Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token ) : RedirectResponse
$request Symfony\Component\HttpFoundation\Request
$token Symfony\Component\Security\Core\Authentication\Token\TokenInterface
return Symfony\Component\HttpFoundation\RedirectResponse
    public function onAuthenticationSuccess(Request $request, TokenInterface $token)
    {
        if ($this->security->isGranted('ROLE_ADMIN')) {
            return new RedirectResponse($this->router->generate('admin_index'));
        } else {
            return new RedirectResponse($this->router->generate('blog_index'));
        }
    }
AuthenticationSuccessHandler