-
Notifications
You must be signed in to change notification settings - Fork 0
Disconnect Flow #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disconnect Flow #38
Conversation
…ct the app during the token validation.
dkotter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this in conjunction with the middleware PR that adds disconnect support and everything seems to be working great. For now, going to leave this unmerged as we've already submitted the plugin to WordPress.org for review. Will merge this in once that is approved and we're ready for public release.
Since we needed to re-submit anyway to resolve a few issues, merged this in so it will be included as part of the initial review |
Description of the Change
/wp-json/jobber/v1endpoint as theclientUrlto the middleware./disconnectfor the disconnect request.get_endpoint( $path )method so the$urlvariable is the base API URL.$refresh_endpoint = Jobber::get_endpoint( 'refresh' ); // middleware refresh URL$disconnect_endpoint = Jobber::get_endpoint( 'disconnect' ); // middleware disconnect URL$token_endpoint = Token::get_endpoint( 'generate' ); // WP token generate URL$auth_endpoint = Token::get_endpoint( 'validate' ); // WP token validate URLtokenUrlparameter with the initial/authrequest./token/generateURL for us to generate aclient_token./wp-json/jobber/v1/disconnectendpoint to handle Jobber > WP disconnects.POSTrequest to this endpoint when a Jobber Webhook is received.POSTrequest will validate thejobber_tokenfrom the middleware and delete the DB records if successful.POSTrequest to[middleware]/disconnectwhen the WP "Disconnect" button is clicked.POSTrequest will include theclientTokenparameter.clientTokenwith thedisconnectparameter appended to the API endpoint.disconnectargument and run thedisconnect_client()method on successul validation.&jobber_disconnected=trueparameter in the URL.POSTrequest may not be complete by time the page refreshes)Closes #19
How to test the Change
Changelog Entry
Credits
Props @TylerB24890
Checklist: