Use the current JWT before each file upload - #6246
Open
bram-atmire wants to merge 1 commit into
Open
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.
References
Fixes #3979
Description
File uploads now use the current JWT immediately before each file is sent. Previously, ng2-file-upload retained the Authorization value captured when the uploader was initialized, so later uploads on an open submission form could fail after token renewal.
The existing upload callback now updates the library's
authTokenfield usingAuthService.buildAuthHeader(). This avoids adding a second Authorization header. The CSRF handling remains independent.Instructions for Reviewers
This fixes stale credentials on subsequent uploads. It does not change the token attached to a request already in flight or address expiry during a single long SAF upload.
Validation: all 13 focused tests pass (uploader, submission upload, and bitstream replacement). The uploader regression tests verify the actual library's outgoing headers across token renewal and clear cached credentials when authentication disappears. Full ESLint validation passes with warnings only.
npm run check-circ-depspasses on the clean source tree, afternpm run clean:decorator:registriesremoves build-generated registries, matching CI's pre-build check.Checklist
main; small change with no new dependencies.