Environment variables set in Amplify not being picked up in deployment

0

We have included console.logs for the process.env.GOOGLE_CLIENT_ID. This logs correctly on our locally hosted app, but returns undefined on our deployed app. We definitely have this variable in our amplify environment variables.

Context: We are using NextAuth for our login using Google feature, which requires the following variables which we have set in our local .env file and in our amplify environment variables: clientId: process.env.GOOGLE_CLIENT_ID, clientSecret: process.env.GOOGLE_CLIENT_SECRET

Logging in using google works fine on our locally hosted app. When we try this same feature on our Amplify-deployed app, we get a “SIGNIN_OAUTH_ERROR” with the message “client_id is required” which means that somehow, the process.env.GOOGLE_CLIENT_ID env variable we’ve set up in Amplify is not being picked up.

nkechi
asked 2 months ago111 views
1 Answer
0
nkechi
answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions