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

    Custom registration for user, and use registration response (and token) to continue process with this logged user

    Scheduled Pinned Locked Moved
    General Discussion
    2
    4
    1.2k
    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.
    • D
      didier
      last edited by

      Hi,

      I need to implement a custom workflow for user registration. Then, my angular app use an endpoint back to register, and this back return register response (combined) to Angular.

      In my Angular app, how to continue as a logged user. Using access token provided by registration endpoint ? How to it with Angular FusionAuth SDK to use all others features in FusionAuth SDK. We need to customize only registration part.

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

        Not sure exactly if this is what you need but probably you can implement your own backend app to communicate with FusionAuth however you see fit. Just like what I did here in NestJS. Then in my react app I have a normal form and then sends an HTTP request to my backend endpoint. So in other word I am not using startLogin helper function.

        Yes, I know it is not angular. But just to light your creativity I thought it is a good idea too look at it from a different perspective.

        BTW I appreciate it if you could give my repo a star if it did help you.

        D 1 Reply Last reply Reply Quote 1
        • D
          didier @kasir-barati
          last edited by

          @kasir-barati Thank you for help ! I think that, in your case, user needs to login after register. I would like to avoid login. After registration, FusionAuth api returns an access token. I do not know how to continue with it or maybe there are an other solution

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

            @didier hmm, I guess you can do it by registering user in your backend (get username, and password from the user and register a user with those). Then you can just exchange the plain text username, password for JWT tokens and attch them to response cookies. Something like this: https://github.com/kasir-barati/you-say/blob/main/apps/backend-e2e/src/utils/login.util.ts.

            If you're using FusionAuth Typescript client you can do it like this: https://github.com/kasir-barati/you-say/blob/main/packages/backend/auth/src/lib/services/mobile-auth.service.ts#L71

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