DenoDDeno
Powered by
brandonk3ntB
Denoβ€’12mo agoβ€’
2 replies
brandonk3nt

Google OAuth2 flow with Deno Fresh

Asking for a little assistance with my Google auth flow- specifically for nuances with redirecting and creating/accessing cookies (I use a "token" cookie for auth). Here's my current flow, please advise where something looks "off":
1. User clicks Google OAuth link and does the OAuth "dance" with Google in a popup.
2. Google OAuth redirects to my redirect_url
3. At my redirect URL, I create a token and set it as a cookie, then redirect to my authenticated home route *with a 302 response and a "location" header. (Should I be using Response.redirect("/") here instead of a 302?

The problem is that at "/" when I try to read the cookie I set in step #3, server-side logs show that the cookie doesn't exist even though I just set it, but I can see it plain as day in the chrome dev tools. Any suggestions or walkthru's for Google Oauth flow? Thanks!
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Deno fresh
TheYuriGTTheYuriG / help
3y ago
Routes with Deno and Fresh
BhauminBBhaumin / help
2y ago
Using buf.build SDKs with Deno (and Deno Fresh)
wcyganWwcygan / help
14mo ago