digiaonline/yii2-account

Event after signup & before login

Closed this issue · 1 comments

One of my applications needs back compatibility with old account system written a long time ago.
For example: after signup I need to duplicate data to the old account database.
And another one: before login I need to check old account database for user + password matching and if it's true -> create password in new account system.
Dont you know, is there any way to bind event listeners for such cases in Yii without modifying your code?
I suppose there is only way to create a fork and update it manually everytime ( -_-) or create additional actions/bash scripts & etc.

You can extend the SignupController and override the afterSignup method. To use your own controller you can use the controllerMap. More on it here https://github.com/nordsoftware/yii2-account#custom-controllers.

As for the before login we could add a similar event and method so that you don't have to create your own User class (web user). I'll take a look at that.