Open tankerkiller125 opened 5 years ago
Additionally if this isn't so much a bug but a feature request, I'm sorry in advance for using the wrong format. This just seems more like a bug than a feature thing to me since Flarum is the only service I know of that doesn't allow different emails between OAuth2 providers.
Server displays a prompt asking if user wants to sign in using existing account or register new one
The base would be an option to connect SSO providers directly from the user's profile when logged in. Your proposed workflow would basically be a login followed by a redirect to that page.
So, from my perspective, adding that section to the user's profile would be the more important first step here.
In addition to the proposed UX change for adding accounts, I think as much as possible of the code for registering / logging in users via external login providers should beoved to API from Forum. One issue though: if the username isn't provided, there needs to be a way to have the user enter that. This means that some amount of code will need to be kept in forum. However, I still think that the actual logging in and registering should be handled via an API endpoint. Any ideas for more elegant ways to handle username providing?
Currently we use data provided by the OAuth2 provider to guess/recommend a username, I would recommend that we keep that feature.
I'd agree with that, and I think that the login provider system we have now, although it could use some cleaning (particularly in how it deals with frontend, I don't like that the login modal needs to be open for it to work) could set a good base for expansion. I'd say that there should be 1 login and 1 registration controller, and the login driver should be chosen based on a GET parameter to the endpoint. If missing, the system should go with a "default" login provider (the username password system)
Bug Report
Current Behavior The current behavior relies on email addresses to compare user authentication, this means that if a user uses an OAuth2 account that doesn't use the same email as a previous account that user ends up with two accounts.
Steps to Reproduce
Expected Behavior We should do this exactly the same way all other systems do this as described:
User Has Account Already (E-Mail Matches)
User Has Account Already (E-Mail Doesn't Match)
User Does Not Have Account
Screenshots If applicable, add screenshots to help explain your problem.
Environment
Possible Solution From my understanding from a forum post I made the code to store additional data from OAuth2 providers has already been implemented. It should be possible to I believe that this is mostly a UI change to make this change function. I don't know exactly what needs to happen in order to make this function in the backend or for that matter if this can be done using a plugin.