The <RedirectToUserProfile /> component will navigate to the Account Portal User Profile URL which has been configured in your application instance. The behavior will be just like a server-side (3xx) redirect, and will override the current location in the history stack.
To find your User Profile URL:
Navigate to the OneAuxilia Dashboard.
In the navigation sidebar, select Account Portal.
Under User profile, select the Visit icon.
Usage
Next.js React Remix
Copy import { OneAuxiliaProvider, SignedIn, SignedOut, RedirectToUserProfile } from '@oneauxilia/nextjs'
import { AppProps } from 'next/app'
function MyApp({ Component, pageProps }: AppProps) {
return (
<OneAuxiliaProvider {...pageProps}>
<SignedIn>
<RedirectToUserProfile />
</SignedIn>
<SignedOut>Sign In</SignedOut>
</OneAuxiliaProvider>
)
}
export default MyApp
Copy import { OneAuxiliaProvider, SignedIn, SignedOut, RedirectToUserProfile } from '@oneauxilia/oneauxilia-react'
function PrivatePage() {
return (
<OneAuxiliaProvider publishableKey={`YOUR_PUBLISHABLE_KEY`}>
<SignedIn>
<RedirectToUserProfile />
</SignedIn>
<SignedOut>Sign In</SignedOut>
</OneAuxiliaProvider>
)
}
Copy import { SignedIn, SignedOut, RedirectToUserProfile } from '@oneauxilia/remix'
export default function Index() {
return (
<div>
<SignedIn>
<RedirectToUserProfile />
</SignedIn>
<SignedOut>
<p>Sign in </p>
</SignedOut>
</div>
)
}
Last updated 3 months ago