H
Hono3mo ago
AmaraFray

google auth

what does this even do , what is it supposed to be expecting (Required parameters were not found. Please provide them to proceed. i get this error) await googleAuth({ client_id: c.env.GOOGLE_ID, client_secret: c.env.GOOGLE_SECRET, redirect_uri: 'http://localhost:5173/auth/google/callback', scope: ['openid', 'email', 'profile'], })(c, next) minimum reproducable code const app = new OpenAPIHono() app.get('/auth/google/sign-in', async (c : Context, next) => { await googleAuth({ client_id: c.env.GOOGLE_ID, client_secret: c.env.GOOGLE_SECRET, redirect_uri: 'http://localhost:5173/auth/google/callback', scope: ['openid', 'email', 'profile'], })(c, next) }, (c) => { const token = c.get('token') const grantedScopes = c.get('granted-scopes') const user = c.get('user-google') return c.json({ token, grantedScopes, user, }) })
3 Replies
AmaraFray
AmaraFrayOP3mo ago
(or just any auth really im going to cry if i cant fig this out, i've been trying so many libraries)
Hurby
Hurby3mo ago
hey, you can check out better-auth or lucia
AmaraFray
AmaraFrayOP3mo ago
you're amazing. better auth has good documentation and looks promision, will try

Did you find this page helpful?