Skip to content

Debugging CSRF bug #1178

Closed
Closed
@Paulson-Robert

Description

@Paulson-Robert
Contributor

Ref : Ticket

Activity

Paulson-Robert

Paulson-Robert commented on May 20, 2025

@Paulson-Robert
ContributorAuthor

My findings for this issue is:

Issue 1: On refresh on home page result in runpixel failures
Fix: Move the axios interceptor code inside App component instead of placing it out side
And also changed one condition like

Image

Issue 2: runPixel POST call triggered from sdk are failing.
Fix: sdk runpixel function uses fetch intead of axios.

Image

And also from here I see a const CSRF constant set as false, and inside interceptor checking with true condition. So made the condition like if CSRF is enabled && metod == POST && token is empty, we trigger fetch csrf api to get the token and set it.

Similarly, runpixelAsync call directly uses fetch.
So additionally made this changes as well.

Image

Image

by doing the above changes most of the issues are fixed, though we have to give one more round of testing

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

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @Paulson-Robert

    Issue actions

      Debugging CSRF bug · Issue #1178 · SEMOSS/semoss-ui