If you suggest to extend [`ConnectController`](https://github.com/hwi/HWIOAuthBundle/blob/master/Controller/ConnectController.php#L272-L281) you could remove ~5-6 lines from this code.