If your application requires fields not included in Frontegg's default sign-up form, such as country or organization type, you can create your own custom sign-up form and UI. Use Frontegg's sign-up API to register users and then seamlessly redirect them into the application using the appropriate requestAuthorize hook or method, based on the SDK you’re using.
Frontegg's sign-up API will return an access token and a fe_refresh cookie if there is no email verification forced on the environment. When this endpoint is called from the client - it will set the cookie on the browser level.
In order for the user to be logged in into your application after the sign-up, you'll need to trigger a refresh request that will check whether there is a valid refresh token on the user's browser and if yes, the user will get automatically logged in, into your application.
You may use either __requestHostedLoginSilentAuthorize or requestAuthorize, there is no significant difference and you may use either. The below example is from @frontegg/react, but these methods exist in all client-side SDKs.
import { useLoginActions } from '@frontegg/react'
const { __requestHostedLoginSilentAuthorize } = useAuthActions();
const { requestAuthorize } = useLoginActions();
// afterSignup
__requestHostedLoginSilentAuthorize()
.catch(() => {
// redirect to login
}).then(() => {
// redirect to app
});
Rate limits
Rate limits
The sign-up route is intended for client-side use and is rate-limited accordingly.
That's it! The user has been successfully signed up and redirected as an authenticated user into your application.