Implement Wix token persistence, refresh flow, and live API routes#492
Open
AJaySi wants to merge 1 commit into
Open
Implement Wix token persistence, refresh flow, and live API routes#492AJaySi wants to merge 1 commit into
AJaySi wants to merge 1 commit into
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
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.
Motivation
Description
_get_current_user_id,_resolve_valid_wix_token, and_map_wix_errorto resolve current user, load/refresh persisted tokens viaWixOAuthServiceandWixService.refresh_access_token, and map errors to401/403/5xxHTTP responses./connection/statusand/statusto returnconnected: trueand livesite_info/permission metadata using the resolved access token andwix_service.check_blog_permissions./publishto resolvemember_id, callWixService.create_blog_post(...), persist refreshed tokens when applicable, and return canonical fieldspost_id,url, andpublish_state./categoriesand/tagsto proxy real responses fromWixService.get_blog_categoriesandWixService.get_blog_tagsusing the resolved token./disconnectto revoke stored token records for the current user viaWixOAuthService.revoke_tokenand return a disconnected status.Testing
python -m py_compile backend/api/wix_routes.pyand it succeeded.f2f8d98) after local validation; no additional automated integration/unit tests were executed in this rollout.Codex Task