143 osm auth#383
Merged
Merged
Conversation
|
Awesome!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces the ability to link a 3rd-party authentication provider with an existing OIM account, or to sign up through an external 3rd-party provider. For now, OpenStreetMap is the only provider supported, but by using the allauth application it should be quite easy to configure new providers.
The main work in this PR involved an update to the entire user interface side of account and profile management by reverting to the default allauth template patterns, and removing the existing sign up/sign in workflow that was handled through a custom modal.
Changing the existing flow via modal to a simpler template-based setup
A single modal was used for sign in or sign up, and when the form was submitted, the current page would reload with the user signed in.
I really liked this set up (I replicated it from GeoNode's approach) because it is sleek and streamlined. However, with the addition of 3rd-party providers, which requires more forms and buttons and things, as well as the open ticket #354, I decided it would be best to simplify the setup and remove this custom modal, in favor of a flow that simply follows what allauth's templates support by default
Also, the
next=url parameter will redirect to whatever page the sign in form was entered from, so nothing should really be lost from a usability standpoint.User account vs. public profile
This update also introduces a distinction between a user's public profile, which anyone can see and displays the user's activity log, and a user's account, within which they can manage their email address, change password, change profile pic, and (now) connect to 3rd-party authentication providers.
Profile page now has a link to manage your account when you are signed in:
Account management page has different tabs for different actions (this follows default allauth templates, updated to fit the site theme):
This setup also sets the stage for a new "preferences" section will be helpful for #232 and related requests.
3rd-party provider functionality
Users can now elect to create a new account "via" their OpenStreetMap account during the sign up process. What really happens if you chose that you are sent to authenticate your OSM account (to prove that you are you) and then you are sent back to OIM for the completion of your OIM account. Your username will be prepopulated with your OSM username, and you'll still need to enter an e-mail address. You do not set a password, though you can later, if you want.
To link an existing account to OpenStreetMap, just sign into your OIM account and go to the Account Connections tab. Click the OpenStreetMap icon and follow the prompts.
To remove a connection to OpenStreetMap you will need to do two things:
OldInsuranceMaps.netentry.Funded by OpenHistoricalMap