• Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login
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 14 May 2024, 10:21

    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 M 2 Replies Last reply 14 May 2024, 10:28 Reply Quote 0
    • K
      kasir-barati @kasir-barati
      last edited by 14 May 2024, 10:28

      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 14 May 2024, 18:16 Reply Quote 0
      • K
        kasir-barati @kasir-barati
        last edited by 14 May 2024, 18:16

        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 16 May 2024, 21:31 Reply Quote 0
        • K
          kasir-barati @kasir-barati
          last edited by kasir-barati 16 May 2024, 21:31

          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
          • M
            mark.robustelli @kasir-barati
            last edited by 17 May 2024, 21:50

            @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 18 May 2024, 09:28 Reply Quote 0
            • K
              kasir-barati @mark.robustelli
              last edited by 18 May 2024, 09:28

              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.

              M 1 Reply Last reply 20 May 2024, 23:48 Reply Quote 0
              • M
                mark.robustelli @kasir-barati
                last edited by 20 May 2024, 23:48

                @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
                6 out of 7
                • First post
                  6/7
                  Last post