I think .env is not working or im just missing something?

Hey guys good day, I solved my problem just now about the Google log-in auth and it is good but I don't want my client id to be displayed on my code, so I used .env file to store my client_id but the when I start to log in using the .env name the whole log in will failed and I got the error back? The 1st image where I just put my client_id on my code and the whole thing works fine but when I put the .env name var on the client_id the whole thing will failed I will get 3 error's "Failed to load resource: the server responded with a status of 403 ()", "The given client ID is not found." and "m=credential_page_library:45 [GSI_LOGGER]: Parameter client_id is not set correctly." The second Image will show the error's where I put the .env name var
No description
3 Replies
Omer
Omer2y ago
Hey @earlv , You can review the env variable document in CRA https://create-react-app.dev/docs/adding-custom-environment-variables/
Adding Custom Environment Variables | Create React App
Note: this feature is available with react-scripts@0.2.3 and higher.
foreign-sapphire
foreign-sapphire2y ago
this is the first image sorry I just removed the email for security privacy
No description
foreign-sapphire
foreign-sapphire2y ago
Thanks @Omer It solved my problem, Thanks alot!! logojewel