Entering a wrong token looked exactly like entering none: the page came back
unchanged, so a typo, a token from the wrong repository and a rotated one were
indistinguishable from a broken button.
The page asks the server before it stores anything. A new endpoint answers 204
or 403 for a token in the header — the header, because this is asked before a
cookie exists and because a foreign page cannot set one — and the key reports a
refusal at once, naming where the right token lives, without storing it. A
stored token the server no longer accepts turns the key red instead of leaving
the page looking untouched.
The instance also logs the absolute path of its token file at startup: it is
relative to the service's working directory, which on an instance serving
several repositories is the one the systemd unit names and not any of the
others, and a token from the wrong one is silently just a wrong token.
Entering a wrong token looked exactly like entering none: the page came back
unchanged, so a typo, a token from the wrong repository and a rotated one were
indistinguishable from a broken button.
The page asks the server before it stores anything. A new endpoint answers 204
or 403 for a token in the header — the header, because this is asked before a
cookie exists and because a foreign page cannot set one — and the key reports a
refusal at once, naming where the right token lives, without storing it. A
stored token the server no longer accepts turns the key red instead of leaving
the page looking untouched.
The instance also logs the absolute path of its token file at startup: it is
relative to the service's working directory, which on an instance serving
several repositories is the one the systemd unit names and not any of the
others, and a token from the wrong one is silently just a wrong token.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Entering a wrong token looked exactly like entering none: the page came back
unchanged, so a typo, a token from the wrong repository and a rotated one were
indistinguishable from a broken button.
The page asks the server before it stores anything. A new endpoint answers 204
or 403 for a token in the header — the header, because this is asked before a
cookie exists and because a foreign page cannot set one — and the key reports a
refusal at once, naming where the right token lives, without storing it. A
stored token the server no longer accepts turns the key red instead of leaving
the page looking untouched.
The instance also logs the absolute path of its token file at startup: it is
relative to the service's working directory, which on an instance serving
several repositories is the one the systemd unit names and not any of the
others, and a token from the wrong one is silently just a wrong token.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A stored token that leaves the page in its visitor form has two causes that
looked identical: the token is wrong, or it is right and the cookie carrying it
does not reach the server. The key asks the verify endpoint with the header and
names the one that applies, because the two need opposite reactions.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mi
merged commit b57fc10a24 into main2026-09-10 07:27:29 +02:00
mi
deleted branch token-feedback2026-09-10 07:27:29 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Entering a wrong token looked exactly like entering none: the page came back
unchanged, so a typo, a token from the wrong repository and a rotated one were
indistinguishable from a broken button.
The page asks the server before it stores anything. A new endpoint answers 204
or 403 for a token in the header — the header, because this is asked before a
cookie exists and because a foreign page cannot set one — and the key reports a
refusal at once, naming where the right token lives, without storing it. A
stored token the server no longer accepts turns the key red instead of leaving
the page looking untouched.
The instance also logs the absolute path of its token file at startup: it is
relative to the service's working directory, which on an instance serving
several repositories is the one the systemd unit names and not any of the
others, and a token from the wrong one is silently just a wrong token.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com