This repository was archived by the owner on Jul 14, 2025. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork121
FEATURE: Allow specifiying required paths when retrieving userinfo#96
Merged
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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
davidtaylorhq approved these changesJan 31, 2024
Uh oh!
There was an error while loading.Please reload this page.
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
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.
Uh oh!
There was an error while loading.Please reload this page.
When retrieving
userinfowithoauth2_fetch_user_details=true, we sometimes want to disallow account creation if an attribute is not fulfilled.This PR adds a new register
oauth2_basic_required_json_pathwhich will kick in when retrievinguserinfo. It can be used this way:If the attribute does not satisfy the required value, we will see the specified error message when returning to the forum. The account is not created.
Alternatives
The alternatives I can think of is
(1) is definitely brittle, and (2) does feel like there will be a lot of copy-work even within the method itself.
on(:after_auth)exists. However the event happens slightly too late - the associated account would have been created already, and theresultwould not contain the required attribute.