Skip to content

fix: send session and CSRF token when generating IRIs - #2845

Merged
blushi merged 1 commit into
devfrom
fix/iri-gen-csrf
Nov 25, 2026
Merged

blushi merged 1 commit into
devfrom
fix/iri-gen-csrf

Conversation

@blushi

@blushi blushi commented Nov 25, 2026

Copy link
Copy Markdown
Member

Description

Send the session cookie and X-CSRF-TOKEN on POST /data/v2/iri-gen from project creation, project editing, and credit batch creation.
Refresh the CSRF token and retry once when the API rejects it.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • provided a link to the relevant issue or specification
  • provided instructions on how to test
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

How to test

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items
.

I have...

  • confirmed all author checklist items have been addressed
  • reviewed code correctness and readability
  • verified React components follow DRY principles
  • reviewed documentation is accurate
  • reviewed tests
  • manually tested (if applicable)

@netlify

netlify Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for terrasos ready!

Name Link
🔨 Latest commit ee7a43f
🔍 Latest deploy log https://app.netlify.com/projects/terrasos/deploys/6b06ac0cb9ca2e033bbcc0bd
😎 Deploy Preview https://deploy-preview-2845--terrasos.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T09:38:56.755717Z ee7a43f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mergify

mergify Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Adds session cookies and CSRF tokens when generating IRIs for project creation, project editing, and credit batch creation.

  • Project and batch submissions send session and CSRF details when generating an IRI.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Generate IRI] --> B[Get cached or fresh CSRF token]
  B --> C[POST metadata with cookies and token]
  C --> D{Explicit CSRF rejection?}
  D -->|No| E[Return result or error]
  D -->|Yes| F[Fetch fresh token]
  F --> G[Retry POST once]
  G --> E
Loading

Reviews (1) · Last reviewed commit: "fix: send session and CSRF token when ge..." · Reviewed by Greptile

@blushi
blushi merged commit b8e954b into dev Nov 25, 2026
16 checks passed
@blushi
blushi deleted the fix/iri-gen-csrf branch November 25, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant