FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Issue with use OAuth with react blog - using NextJs ts

    Scheduled Pinned Locked Moved Unsolved
    Q&A
    2
    2
    1.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rationem
      last edited by

      Hi,
      I am attempting to follow the OAuth with react blog
      My stack uses NextJs and NestJs (built on express).
      In the server login route, I am getting a typescript error.
      The code with the error is:

      @Get('/login')
        public async login(@Req()request: Request, @Res() response: Response){
          const state = crypto.randomBytes(64)
          request.session.oauthState = state;
        }
      

      The typescript error is

      Property 'oauthState' does not exist on type 'Session & Partial<SessionData>'.ts(2339)
      

      I have the latest types definition file
      @types/express-session": "^1.17.5",

      Could you assist?

      Many thanks

      K 1 Reply Last reply Reply Quote 0
      • K
        kasir-barati @rationem
        last edited by

        @rationem You could look at my backend app in this monorepo: https://github.com/kasir-barati/you-say

        There I've implemented a NestJS custom backend app. BTW I have a question for you, right now my NextJS frontend build is broken and I do not know why, I mean I kinda know that it is because I am using @fusionauth/react-sdk and it needs to have access to document object but since during build it does not have that my build is defective. Any suggestion?

        I also read this doc but it was not what I wanted since it was communicating directly with FusionAuth and in my case I do not want that 🙂.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post