-
Notifications
You must be signed in to change notification settings - Fork 217
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
test(auth): ensure failed cookie auth attempt instructs user-agent to clear cookie #1336
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #1336 +/- ##
==========================================
+ Coverage 80.81% 80.88% +0.07%
==========================================
Files 43 43
Lines 3336 3349 +13
==========================================
+ Hits 2696 2709 +13
Misses 512 512
Partials 128 128
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Example of the test failing earlier when I pushed it up:
It ensures that an expired token cookie is cleared when presented to an endpoint other than the explicit expire one. |
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.
lgtm! we should prob also rebase this onto the release/1.18
branch for v1.18.2
today
Supports #1334
I believe there might exist a deeper experience issue with the UI's handling of entering an unauthenticated state.
However, as pointed out, the expire token self endpoint is an authenticated route.
This means we can only expire a valid (non-expired) authenticated request.
I believe this is correct and fair behaviour. Because the operation is a mutating and destructive action that should only be performed by an authenticated party.
That said though, I think it might be prudent to instruct the user agent to actually expire the cookie in all cases where a token is presented via a Cookie header, but that leads to an unauthenticated response.
I suspect this might not actually fix the whole end-to-end problem in #1334 but I think it is worth doing.