Compare commits
3 Commits
1cd24ce541
...
9b1223f467
Author | SHA1 | Date |
---|---|---|
|
9b1223f467 | |
|
0debb59474 | |
|
215f376d4b |
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hono/oidc-auth': minor
|
||||
---
|
||||
|
||||
Support empty OIDC_CLIENT_SECRET
|
|
@ -0,0 +1,18 @@
|
|||
name: codestyle
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: ['*']
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
- run: yarn
|
||||
- run: yarn format
|
||||
- run: yarn lint
|
|
@ -167,11 +167,18 @@ export const getClient = (c: Context): oauth2.Client => {
|
|||
const env = getOidcAuthEnv(c)
|
||||
let client = c.get('oidcClient')
|
||||
if (client === undefined) {
|
||||
client = {
|
||||
client_id: env.OIDC_CLIENT_ID,
|
||||
client_secret: env.OIDC_CLIENT_SECRET,
|
||||
token_endpoint_auth_method: 'client_secret_basic',
|
||||
}
|
||||
client =
|
||||
env.OIDC_CLIENT_SECRET === ''
|
||||
? {
|
||||
// No client secret provided, use 'none' auth method
|
||||
client_id: env.OIDC_CLIENT_ID,
|
||||
token_endpoint_auth_method: 'none',
|
||||
}
|
||||
: {
|
||||
client_id: env.OIDC_CLIENT_ID,
|
||||
client_secret: env.OIDC_CLIENT_SECRET,
|
||||
token_endpoint_auth_method: 'client_secret_basic',
|
||||
}
|
||||
c.set('oidcClient', client)
|
||||
}
|
||||
return client
|
||||
|
|
Loading…
Reference in New Issue