File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed
Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @hono/oidc-auth ' : major
3+ ---
4+
5+ Support empty OIDC_CLIENT_SECRET
Original file line number Diff line number Diff line change @@ -167,11 +167,18 @@ export const getClient = (c: Context): oauth2.Client => {
167167 const env = getOidcAuthEnv ( c )
168168 let client = c . get ( 'oidcClient' )
169169 if ( client === undefined ) {
170- client = {
171- client_id : env . OIDC_CLIENT_ID ,
172- client_secret : env . OIDC_CLIENT_SECRET ,
173- token_endpoint_auth_method : 'client_secret_basic' ,
174- }
170+ client =
171+ env . OIDC_CLIENT_SECRET === ''
172+ ? {
173+ // No client secret provided, use 'none' auth method
174+ client_id : env . OIDC_CLIENT_ID ,
175+ token_endpoint_auth_method : 'none' ,
176+ }
177+ : {
178+ client_id : env . OIDC_CLIENT_ID ,
179+ client_secret : env . OIDC_CLIENT_SECRET ,
180+ token_endpoint_auth_method : 'client_secret_basic' ,
181+ }
175182 c . set ( 'oidcClient' , client )
176183 }
177184 return client
You can’t perform that action at this time.
0 commit comments