adding adding active checks on login

In Yii1 when I wanted I performed Login checks, I changed my UserIdentity to a series of if elseif checks to see if a username was found, the password matched, the user was active. While I can do something similar agin this time, I just wondered what the correct way to this would be for Yii2?

I would add method getIsActive() to user model and in login() in LoginForm change to

if ($this->validate() && $this->getUser()->getIsActive())

makes sense?

Yes, thanks very much