Sign in flow not working on deployment on AWS Amplify
I am using the Clerk, Convex template and the sign in flow on the frontend works on my local deployment. However, it does not work on the deployment that we have on AWS Amplify. Is there a configuration that we are missing causing this issue? Here is a screenshot of the env variables configured within Amplify
14 Replies
On the deployment in Amplify the user is rerouted back to the page with the sign in button, however, this time nothing happens even when they click sign in. So I am guessing that nothing the user's credentials are coming to the frontend but for some reason its not being processed right
Is this deployment for a production or non-production branch?
I don't know how it works in Vite, but the Next.js env var has a public modifier in the name:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
https://docs.convex.dev/auth/debug might be helpful to narrow down the problem
Debugging Authentication | Convex Developer Hub
You have followed one of our authentication guides but something is not working.
according the Clerk/Convex template, it directed to use: VITE_CLERK_PUBLISHABLE_KEY
whats weird is that the frontend, and auth works on local but on the AWS Amplify deployment
What is your amplify deployment URL?
I just went through the Google Sign in and saw this:
This might be an issue between Clerk dev mode and Google dev mode
You also seemed to add some username field. Not sure what this is for
what is confusing is that this works locally, so not sure why it wont work on AWS Amplify with the same env variables
I just tried google sign in, I dont see this
Upon verifying the traffic between clerk and the frontend on amplify, I can see that clerk is sucessfully sending back the jwt token to the frontend, however the frontend logic is not able to retrieve this properly. But again, as I said earlier this is weird as this works locally
Do I have to change the value of this to the value set in my amplify deployment as well for
VITE_CLERK_PUBLISHABLE_KEY
?
https://github.com/SWE-Group6/phase2/blob/main/src/ErrorBoundary.tsx#L29
This means that clerk is doing its join in giving the JWT token however the Authenticated component from convex/react is missing configuration?
@Matt Luo any ideas on what could be the issue?Not off the top of my head. I think you need to go through each step in the auth/debug webpage the sshader referenced
@nikhildhoka when I try this I see
What does your convex/auth.config.ts look like?
If you're using two different CLerk configs for dev and prod then you'll want to list both of them in convex/auth.config.ts
https://jwt.io/ says my token is
so
applicationID
should be "convex" and domain
should be https://flowing-pangolin-4.clerk.accounts.dev
I noticed that my CLERK_JWT_ISSUER_DOMAIN was configured incorrectly in the prod instance in convex and hence it was not working
issue is fixed now
authentication works
thank you so much for the help!