Remove token auth - #640
Open
tsubik wants to merge 1 commit into
Open
Conversation
tsubik
force-pushed
the
feature/remove-api-token-auth
branch
from
August 25, 2026 07:41
060acc7 to
abe4ece
Compare
tsubik
marked this pull request as ready for review
August 25, 2026 18:11
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.
Remove token (Bearer/JWT) auth from the API
Follow-up to #610. That PR added cookie auth next to the Bearer token and left both
running behind a
DISABLE_BEARER_AUTHkill switch so the frontends could migrate.Both now log in with cookies, so this deletes the token path for good — no more
non-expiring, non-revocable tokens in LocalStorage, and no
Authorizationheader thatskips the CSRF check.
Breaking — deploy with the frontends
POST /loginno longer returnstoken, and no longer acceptsauth[set_cookie]:auth +
XSRF-TOKENcookies are set on every successful login.Authorization: Bearer <jwt>is ignored; token-only requests get a 401.Removed
lib/auth.rb, thejwtgem (direct dep only — still transitive via omniauth),DISABLE_BEARER_AUTH,#user_from_bearer_token/#bearer_token, theJWT::VerificationErrorhandler.AUTH_SECRETdropped from.env.sample,docker-compose.ymland CI — also needs removing from the servers' shared.env.Tests
authorize_headersnow does a real login instead of minting a JWT, returning theX-XSRF-TOKENheader a browser would send. Consequences:*_headershelpers are no longer memoized — the cookie jar is shared, so whicheverrole logged in last owns it; re-login per call keeps each request honest.
app:option, since both cookies are namespaced per app (observations_spec,download-session spec).