Logic behind authentication only if role is 'admin'
Hello,
In previous project I created a code to authenticate everybody and restrict access to some pages if - in example - the role wasn't 'admin'.
Now I'm working on a new project where I have a login page just for admins and I'd like to not authenticate users - even if pwd and email match - in case role isn't "admin".
@Snapey It's s sort of subscription website. The same instance of Laravel handles siteA.com (the "pay site") and siteB.com (the billing / admin / css domain). I use the table users both for admins both for "normal" users. I'd like to prevent non admin users from logging into siteB.com.
To reply to your previous question, admin is a field of the users table with enum value 'user' and 'admin'.
Using an extra conditions to login will be used in the near future where just "paid" users can get access to siteA.com. In this case I'm going to add an extra field to the table users, something like status with values 'subscribed', 'paid', 'expired', 'cancelled'.