arpittyagi102 / LinkUp

Link Up is a real time chatting application project, it utilizes, MERN, socket.io
https://getlinkup.vercel.app
MIT License
23 stars 30 forks source link

added OneTapGoogleLogin #18

Closed Vyom-V closed 1 year ago

Vyom-V commented 1 year ago

faced issue with frontend env file added another button "quick login" with google symbol which implements oneTap feat

Do let me know for any changes

vercel[bot] commented 1 year ago

Someone is attempting to deploy a commit to a Personal Account owned by @arpittyagi102 on Vercel.

@arpittyagi102 first needs to authorize it.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
link-up ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 3, 2023 7:14pm
Vyom-V commented 1 year ago

Definitely, could you help me a bit with the .env file setup in frontend? I managed to get the backend connected with my mongoDb URI but just creating an .env file in the front-end folder doesnt seem to be working , could be able to provide me with some reference code.,thanks

arpittyagi102 commented 1 year ago

Hey, you should try putting dummy variable in the enviroment variables. that may help for example

const value = process.env.SECRET || "DUMMYVALUE"

this may solve the problem, if it doesn't, let me know

Vyom-V commented 1 year ago

implemented it. image

a change I had to do was in index.js <GoogleOAuthProvider clientId={clientId}> as directly passing client_id to useGoogleOneTapLogin wasnt wokring so I looked into implementation of useGoogleOneTapLogin which was getting client_id from context of GoogleOAuthProvider

Couldn't do the onLoad feature as useGoogleOneTapLogin is a hook and react doesn't allow hooks in useEffect Do let me if you have any idea about the implementation of onLoad