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

    NextJS + custom backend (NestJS)

    Scheduled Pinned Locked Moved Unsolved
    Q&A
    2
    7
    1.5k
    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.
    • K
      kasir-barati
      last edited by

      Hi folks,

      I've been reading https://fusionauth.io/docs/quickstarts/quickstart-javascript-nextjs-web and then I realized that it is communicating directly with FusionAuth. Which means that we where providing it our client secret. I am cool with that idea however I was wondering if that does mean that I can now wipe out my backend RESTful APIs since they are not needed anymore. I mean I can keep them or at least the ones for mobile.

      But in general I was not sure anymore about these endpoints.

      I guess it boils down to whether I need full control over generating JWT tokens and things like that. Or maybe I am missing some points 🤔.

      I also loved the @fusionauth/react-sdk but like I mentioned it is not working and I dunno how to fix it either. I appreciate it if you could help me with that too.

      K mark.robustelliM 2 Replies Last reply Reply Quote 0
      • K
        kasir-barati @kasir-barati
        last edited by

        I've also read:

        1. https://fusionauth.io/community/forum/post/5781
        2. https://fusionauth.io/community/forum/post/5782

        But none of them where what I needed. Though I jot down some comments there too 😃.

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

          Like I mentioned before I tried the docs and I ended up with another bump along the way. It seems like FusionAuth integration with NextJS is not the best idea. Maybe it's time to switch gears and try SPAs 🤔?

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

            We have an open issue for it in @fusionauth/react-sdk: https://github.com/FusionAuth/fusionauth-javascript-sdk/issues/99. But it might not be the answer if you are looking for an answer that utilizes next-auth.

            1 Reply Last reply Reply Quote 0
            • mark.robustelliM
              mark.robustelli @kasir-barati
              last edited by

              @kasir-barati It depends on what you are trying to do. If you are trying to authenticate a user for your application and the login flow that redirects to FusionAuth and returns to your application works, then you would not need the APIs. Even if you need to customize the JWT, I would look into lambdas for that.

              K 1 Reply Last reply Reply Quote 0
              • K
                kasir-barati @mark.robustelli
                last edited by

                Thanks @mark-robustelli for your pointers, although I know how we can leverage lambda functions to customize our JWT tokens but I dunno if we can use them to change what GET /me endpoint returns. That's part of the reason I opt to develop my own backend to communicate with FusionAuth.

                mark.robustelliM 1 Reply Last reply Reply Quote 0
                • mark.robustelliM
                  mark.robustelli @kasir-barati
                  last edited by

                  @kasir-barati When you say "I dunno if we can use them to change what Get /me endpoint returns", you might want to check out the UserInfo Populate Lamba.

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