My symfony3 login page redirects to home by default, as stated inside my security.yml file.
However, I want it to redirect to my \"Edit profile\" page i
I assume you are using the Guard Authentication system. ( http://symfony.com/doc/current/security/guard_authentication.html )
Then you should have a class extending the AbstractGuardAuthenticator class.
In that class, there is a method called onAuthenticationSuccess, in here you can put some logic for redirecting the request.
If you return null here, it will just continue, and use the route configured in your security.yml.
You will need to pass the @router service to the Authenticator class through dependencyInjection.
Assuming you passed the router service, your method will look something like this:
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
/** @var User $user */
$user = $token->getUser();
if ($user->hasCompleteProfile() == false) {
$url = $this->router->generate('edit_profile');
return new RedirectResponse($url);
}
// Continue with default behaviour
return null;
}