I’m trying to get an AWS Lambda api hooked up with a Vite React app using ClerkJS auth. I want to store some user data on sign up and do some other prep on sign in. I want to hit the AWS API rather than redirect to the front end app.
I cannot get the ClerkJS redirects to work all with the AWS endpoints, have tried every combination of params I can imagine.
It all works fine if I redirect to the front end domain, but just redirects to the apps /
route when I try to provide the AWS endpoints.
What’s going on?
Tried adding the params on the sign in button:
<SignedOut>
<SignInButton
forceRedirectUrl={'https://xxxxxx.execute-api.xxxxxx.amazonaws.com/dev/sign-in'}
signUpForceRedirectUrl={'https://xxxxxx.execute-api.xxxxxx.amazonaws.com/dev/sign-up'}
/>
</SignedOut>
<SignedIn>
<UserButton/>
</SignedIn>
I’ve also tried adding the fallback and force redirects to the provider in every possible combination:
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import './index.css'
import {ClerkProvider} from "@clerk/clerk-react";
const PUBLISHABLE_KEY = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY
if (!PUBLISHABLE_KEY) {
throw new Error("Missing Publishable Key")
}
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<ClerkProvider
publishableKey={PUBLISHABLE_KEY}
allowedRedirectOrigins={['xxxxxx.execute-api.xxxxxx.amazonaws.com']}
signInForceRedirectUrl={'https://xxxxxx.execute-api.xxxxxx.amazonaws.com/dev/sign-in'}
signUpForceRedirectUrl={'https://xxxxxx.execute-api.xxxxxx.amazonaws.com/dev/sign-up'}
signInFallbackRedirectUrl={'https://xxxxxx.execute-api.xxxxxx.amazonaws.com/dev/sign-in'}
signUpFallbackRedirectUrl={'https://xxxxxx.execute-api.xxxxxx.amazonaws.com/dev/sign-up'}
>
<App/>
</ClerkProvider>
</React.StrictMode>,
);