formio / formio-service

The Form.IO API Service library for Node.js applications
MIT License
18 stars 19 forks source link

User and admin login account conflict #10

Open rmckeel opened 7 years ago

rmckeel commented 7 years ago

Hello,

It has been fun using this product and trying out the 'Formio ecosystem' - an excellent product.

I am experimenting with a plugin in WordPress using the formio-php library to login or register a user, and get that user's JWT token for form submission. What I noted was that given the case where I have an admin account with a specific email and a user account with the same email (auto-generated in this case via the WordPress plugin), I am only able to log in to the user account.

It seems the login form prefers the user role over the admin role. Is that intentional? I would expect a different result, either:

1) Both user and admin logins work and logs in the appropriate user and role. (If password was somehow the same for both accounts, defaults to logging in the more privileged user role, in this case admin) OR 2) There is a way to do an 'admin' login, and a separate way to do a 'user' login.

Thanks for any advice. Not a big deal for us yet (since we can have the admins jump through hoops - e.g. ryan+email@gmail.com is considered unique from ryan@gmail.com). However, I thought I'd bring it up in case it was unintentional or there was a better solution.

Ryan