If you have two forms, use two classes to process them.
Your source code for user registration and authentication should be as simple and straight forward as possible, to reduce the probability of something going very wrong. If you try to handle two forms in one class, you will have to check a lot of conditions, as you already tried, and it will be ugly.
If you insist on using one class, use different field IDs for each one, such as username_register Vs username_login. But again, bad idea.
--
Marios Zindilis