public function getPreviousUrl(Request $request, $providerKey)
{
// if the user hit a secure page and start() was called, this was
// the URL they were on, and probably where you want to redirect to
return $request->getSession()->get('_security.' . $providerKey . '.target_path');
}