Code Monkey home page Code Monkey logo

Comments (1)

niskah-media avatar niskah-media commented on May 18, 2024

Now I can run into Login page, I just replace useAppData() hook like this:

export const useAppData = (): typeof window.__APP_DATA__ => {
  // if (process.env.NODE_ENV === 'development') {
  //   return {
  //     user: dummyUser,
  //     currentSession: dummySessions[0].sessionId,
  //     grants: dummyGrants,
  //     appName: 'App name',
  //   } as typeof window.__APP_DATA__;
  // }
  return {} as typeof window.__APP_DATA__;
}

But now I reach a CSRF Error into server:

[Nest] 7593   - 10/24/2023, 12:50:17 PM   [ExceptionsHandler] invalid csrf token +197155ms
ForbiddenError: invalid csrf token

request:

POST /auth/login?redirect_uri=%2F HTTP/1.1
Host: localhost:3000
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/119.0
Accept: */*
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: http://localhost:3000/auth/login
Content-Type: application/json; charset=utf-8
X-CSRF-TOKEN: {{csrfToken}}
Content-Length: 63
Origin: http://localhost:3000
Connection: keep-alive
Cookie: G_ENABLED_IDPS=google; _csrf=z-yaFPT1C-3PHeq3yrnscE0M
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Pragma: no-cache
Cache-Control: no-cache

from nestjs-oauth2.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.