Can I change code (a function) on shopify

Hello, I am making an application on shopify by adding some modification

I added a metafield field in the customers which is called (role) and I want to modify the functioning of the login function (customer.login ..) I want this method not only to validate the email and the password but also it must validate the role field

and it depends on the role a page displays (for example: the supplier page is not the same as the customer .. .)

Any idea how I can do this? And thank you in advance