Use kvToken instead of siteKey for examschedule cloud URL token parameter #9
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.
Problem
The examschedule button's
openConfig()function was using the website token (server.siteKey) instead of the KV authorization token (server.kvToken) when constructing cloud data URLs. This was inconsistent with how other parts of the codebase handle KV authentication (e.g.,kvServerProvider.jsalready prioritizeskvTokenfor HTTP headers).Solution
Modified
src/utils/dataProvider.jsto prioritizekvTokenoversiteKeywhen adding the token parameter to cloud URLs. The implementation maintains full backward compatibility by falling back tositeKeyifkvTokenis not available.Changes Made
In the
getKeyCloudUrl()function:Added retrieval of the KV authorization token:
Updated token selection logic with priority fallback:
Updated JSDoc documentation to reflect the token priority behavior
Backward Compatibility
The change is fully backward compatible:
kvTokenis set → useskvTokenkvTokenis empty/null → falls back tositeKeyExample URLs Generated
With kvToken set:
With only siteKey (legacy):
Public access (no token needed):
This change aligns the URL token parameter behavior with the HTTP header authentication pattern already established in
kvServerProvider.js, providing consistent authentication handling across the application.Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.