Closed BarryThePenguin closed 4 months ago
Hi @BarryThePenguin !
Try to update @hono/vite-dev-server
and @hono/cloudflare-pages
, and use the following vite.config.ts
:
import pages from '@hono/vite-cloudflare-pages'
import adapter from '@hono/vite-dev-server/cloudflare'
import honox from 'honox/vite'
import { defineConfig } from 'vite'
export default defineConfig({
ssr: {
external: ['@auth/core']
},
plugins: [
honox({
devServer: {
adapter
}
}),
pages()
]
})
Fantastic, that solved all 3 issues, thank you!
What version of HonoX are you using?
0.1.23
What steps can reproduce the bug?
I created a minimal reproduction https://github.com/BarryThePenguin/honox-auth-js
There's a few issues..
I have a secret defined in
wrangler.toml
, but this doesn't appear to make it to the auth handler. Thec.env
will have the correct environment variables. Butenv(c)
returns something different, which is what@hono/auth-js
useshttps://github.com/honojs/middleware/blob/67b83e5d4cc1bcbbf1d7024a721cec69f3d4ead0/packages/auth-js/src/index.ts#L149
env(c)
appears to be returningprocess.env
, which is missing the environment variables fromwrangler.toml
You can reproduce this locally by building the app and running
wrangler pages dev
What is the expected behavior?
Even without values for
AUTH_GITHUB_ID
andAUTH_GITHUB_SECRET
, I'd expect to be redirected to/api/auth/signin
From https://authjs.dev/getting-started/authentication/oauth
So I'd expect Auth.js to pickup the environment variables automatically
What do you see instead?
No response
Additional information
No response