Custom sign-up UI with auth0-spa-js

Hi there,

I’m working on the React app that uses auth0-spa-js for the whole client-side authentication flow. To put it more plainly when user hits ‘Sign-Up’ button he is redirected to the Auth0 Universal Login Page and after sign-up he is redirected back to the app with the app store data being populated with user data.

It works great, but currently I would like to provide users with alternative path, when they can create an account directly inside my app which requires custom sign-up panel - handling email / password provided by the user and sending it to the Auth0 API.

I have prepared the panel and implemented auth0-js (since auth0-spa-js doesn’t seem to provide a method for signing-up users directly) and it works. So by using WebAuth and signupAndAuthorize method I’ am able to create new user records inside the DB and get an accessToken and idToken back.

So my question is, is there any way to achieve the same result with using only auth0-spa-js? Or at least to pass the received token to the instance of the auth0-spa-js that handles all the authentication user flow inside my app to keep user-related logic in one place?

Hi @cezary.burzykowski,

Welcome to the Community!

There isn’t a built in way to use auth0-spa-js with your custom UI. And there isn’t going to be a straightforward way to integrate the two SDKs, they are meant to be standalone.

I would say it is probably best to just stick with auth0.js if you require a custom UI, because it can also do hosted if you wanted to offer both (I don’t know why you would do this, but there may be a use-case). Otherwise, just use the hosted login page and go with auth0-spa-js.

Hope this clarifies!
Dan

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.