SleepWalker / hoauth

yii-hoauth provides simple integration with social network authorisation lib Hybridauth in Yii.
Other
59 stars 35 forks source link

Avoiding modification of the user module #41

Closed zedrdave closed 10 years ago

zedrdave commented 10 years ago

I have set-up hoauth and it works great. However I would like to avoid modifying the user module files directly and keep them as a clean git submodule in our project (having external modules that cannot be updated easily sounds dangerous in the long term).

It's easy enough inserting the widget in the view with a theme, but is there any way I can avoid modifying the Login Controller's actions in the module file itself?

SleepWalker commented 10 years ago

Youc can create your own controller. Lets say OauthController and add the HOAuthAction there. In widget with buttons you can change route of the controller

$this->widget('...HOAuth', array(
    'route' => 'oauth',
));

if you need to do something special after login you can use OauthController::hoauthAfterLogin($user, $newUser) callback