A WordPress plugin that provides Headless login and authentication for WPGraphQL, supporting traditional passwords, OAuth2/OpenID Connect, JWT, and more.
This PR adds the following Actions/Filters to the plugin:
graphql_login_authenticated_user_data: Filters the user data returned by the Provider, before it is used to match/create the user.
graphql_login_after_authenticate: Triggers after a user is authenticated by the Provider.
graphql_login_pre_get_user_from_data: Lets you shortcircut the user-matching logic.
graphql_login_get_user_from_data: Fires after the WordPress User has been matched.
graphql_login_create_user_data : Filters the provider data used to create a new WordPress user when no match is found.
Additionally: this PR fixes an issue with graphql_login_after_successful_login, where the WP_User was being passed twice, instead of the user data from the provider. Props @martinowren in #83
Why
These actions/filters will let you you modify a Provider's auth behavior without requiring you to create a custom ProviderConfig class, lowering the barrier to entry and making it easier to use the Generic Oauth2 Client (and future generic types 🤫 ).
Inspired by @martinowren over on Slack 🙏
How
Testing Instructions
Additional Info
Supersedes #83
Checklist:
[x] My code is tested to the best of my abilities.
[x] My code follows the WordPress Coding Standards.
[x] My code has proper inline documentation.
[x] I have added unit tests to verify the code works as intended.
[x] I included the relevant changes in CHANGELOG.md
coverage: 83.896% (+0.1%) from 83.799% when pulling 6308990af41ea0df686b99e48311a4a564d31047 on justlevine:dev/client-actions-and-filters into 28a298303b23c0c64b4cf84bd0a16a4d78c8f0d4 on AxeWP:develop.
What
This PR adds the following Actions/Filters to the plugin:
graphql_login_authenticated_user_data
: Filters the user data returned by the Provider, before it is used to match/create the user.graphql_login_after_authenticate
: Triggers after a user is authenticated by the Provider.graphql_login_pre_get_user_from_data
: Lets you shortcircut the user-matching logic.graphql_login_get_user_from_data
: Fires after the WordPress User has been matched.graphql_login_create_user_data
: Filters the provider data used to create a new WordPress user when no match is found.Additionally: this PR fixes an issue with
graphql_login_after_successful_login
, where theWP_User
was being passed twice, instead of the user data from the provider. Props @martinowren in #83Why
These actions/filters will let you you modify a Provider's auth behavior without requiring you to create a custom ProviderConfig class, lowering the barrier to entry and making it easier to use the Generic Oauth2 Client (and future generic types 🤫 ).
Inspired by @martinowren over on Slack 🙏
How
Testing Instructions
Additional Info
Supersedes #83
Checklist: