I have a database with already existing data, with name, CPF, RG and other personal data. I need to implement a login system, but I wanted the user to be in the case the registration number and the password the CPF, for example. In the login statements, I'm always prompted to do a new model with username and password. I would like to ask if I could use the same table that I already have the personal data to login to, or would I have to copy the data from this table to a new model, dedicated only to User?
What if I wanted to let the user log in with both email and registration number? How would you do this query?