Skip to content

Change session auth to pass around one-time redeemable tokens rather than session tokens - #8217

Open
Prospector wants to merge 1 commit into
mainfrom
prospector/new-auth-passing-method
Open

Prospector wants to merge 1 commit into
mainfrom
prospector/new-auth-passing-method

Conversation

@Prospector

Copy link
Copy Markdown
Member

No description provided.

@Prospector
Prospector added this pull request to stack #8218 November 3, 2026 20:55
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Note

This changelog has been merged into the changelog for #8142

Pull request changelog

App

Added

Changed

Deprecated

Removed

Fixed

Security

Website

Added

Changed

Deprecated

Removed

Fixed

Security

Hosting

Added

Changed

Deprecated

Removed

Fixed

Security

@greptile-apps

greptile-apps Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[High impact] The change reaches OAuth sign-in across the website and launcher.

The backend response-type requirement must be satisfied before merging; no new blocking behavior was found.

Summary

This PR replaces OAuth redirect session tokens with short-lived, one-use login codes bound to a browser-held verifier.

  • OAuth callbacks now send a short-lived code instead of a session.
  • The sign-in page proves its tab before exchanging an OAuth code.
  • Search indexing keeps its current behavior.

Reviews (2) · Last reviewed commit: "one-time auth codes instead of handing s..." · Reviewed by Greptile

pool: Data<PgPool>,
redis: Data<RedisPool>,
body: web::Json<ExchangeLoginCode>,
) -> Result<HttpResponse, ApiError> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Response type hides JSON

exchange_login_code returns only JSON on success, but declares HttpResponse. The backend guide requires web::Json<T> when possible. Return web::Json<AuthSession> and finish with Ok(web::Json(session)) so Rust can check the response type. This repository requirement must be satisfied before merging.

Context Used: apps/labrinth/AGENTS.md (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/labrinth/src/routes/internal/flows.rs
Line: 1605

Comment:
**Response type hides JSON**

`exchange_login_code` returns only JSON on success, but declares `HttpResponse`. The backend guide requires `web::Json<T>` when possible. Return `web::Json<AuthSession>` and finish with `Ok(web::Json(session))` so Rust can check the response type. This repository requirement must be satisfied before merging.

**Context Used:** apps/labrinth/AGENTS.md ([source](https://github.com/modrinth/code/blob/main/apps/labrinth/AGENTS.md))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@Prospector
Prospector requested a review from a team November 4, 2026 19:14
@mergify

mergify Bot commented Nov 10, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request

Base automatically changed from prospector/auth-modal to main November 10, 2026 20:42
@Prospector
Prospector force-pushed the prospector/new-auth-passing-method branch from 98495bb to c9fcb8b Compare November 10, 2026 20:42

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant