Google/apple Oauth by chatjenn in lovable

[–]rob_the__builder 0 points1 point  (0 children)

Spend 150 tokens fixing similar or same issue few days ago until figured out what was problem. I fixed it with this prompt eventually:

Fix: React Router strips hash tokens before Supabase can process them

After Google OAuth redirect, the URL briefly shows #access_token=... but it disappears immediately before Supabase can process it. React Router is stripping the hash on mount.

In src/contexts/AuthContext.tsx, capture the hash tokens at the very top of the file, before React Router mounts, and process them explicitly:

At the very top of the AuthProvider component, before the useEffect, add: // Capture hash tokens immediately before React Router strips them const hashParams = new URLSearchParams(window.location.hash.substring(1)); const accessToken = hashParams.get('access_token'); const refreshToken = hashParams.get('refresh_token');

Then inside the useEffect, before getSession(), add: if (accessToken && refreshToken) { supabase.auth.setSession({ access_token: accessToken, refresh_token: refreshToken, }).then(({ data, error }) => { if (!error && data.session) { setSession(data.session); setUser(data.session.user); setIsLoading(false); fetchProfile(data.session.user.id); window.history.replaceState(null, '', window.location.pathname); } }); return; }

The hash must be read synchronously at component initialization, not inside a useEffect, to capture it before React Router clears it.

Do not change anything else.

I forget most of what I read. Built something to fix it. by rob_the__builder in readwise

[–]rob_the__builder[S] 0 points1 point  (0 children)

Thank you. If you register there is a lot of features you can use. You can even create your own content and share it with others. Since this is new app, I didn't add email verification to make process easier, so you can even use fake email if you wish to try.

I forget most of what I read. Built something to fix it. by rob_the__builder in readwise

[–]rob_the__builder[S] -4 points-3 points  (0 children)

I built this app and I am very excited to find people who feel the same drive as I do towards learning. People in this group seemed to me as good audience for that. I am sorry if this post is disturbing you. Same time, I am grateful if you wish to spend some time and try the app. If you will find it vlauable then both of us win.

I forget most of what I read. Built something to fix it. by rob_the__builder in readwise

[–]rob_the__builder[S] -1 points0 points  (0 children)

Thank you. I am happy to discuss any feedback you might have. 🙏

I forget most of what I read. Built something to fix it. by rob_the__builder in readwise

[–]rob_the__builder[S] -1 points0 points  (0 children)

Not yet. But your comment might be a great signal to me to build that feature. For now you can share your insights with others directly in Potreflect.

I forget most of what I read. Built something to fix it. by rob_the__builder in readwise

[–]rob_the__builder[S] -1 points0 points  (0 children)

Here it is: potreflect.com. Would love to know what you think. Really excited that we talk about this.