1010import { config } from "dotenv" ;
1111import Provider from "oidc-provider" ;
1212
13- config ( ) ;
14- config ( { path : ".env.local" } ) ;
13+ // Load env files but don't override existing env vars (e.g., from playwright)
14+ config ( { override : false } ) ;
15+ config ( { path : ".env.local" , override : false } ) ;
1516
1617const ISSUER = process . env . OIDC_ISSUER_URL || "http://localhost:4000" ;
1718const PORT = new URL ( ISSUER ) . port || 4000 ;
@@ -106,9 +107,12 @@ const configuration = {
106107 profile : [ "name" ] ,
107108 } ,
108109 ttl : {
109- // Short-lived access tokens to force refresh during dev
110- AccessToken : 15 , // seconds
110+ AccessToken : 15 , // seconds - short-lived to exercise refresh flow
111111 RefreshToken : 86400 * 30 , // 30 days
112+ Interaction : 3600 , // 1 hour
113+ Session : 86400 * 14 , // 14 days
114+ Grant : 86400 * 14 , // 14 days
115+ IdToken : 3600 , // 1 hour
112116 } ,
113117 // Dev-only: always issue refresh tokens to make the flow reliable locally
114118 issueRefreshToken : async ( ) => true ,
@@ -119,7 +123,6 @@ const oidc = new Provider(ISSUER, configuration);
119123// Simple interaction endpoint for dev - auto-login as test-user
120124oidc . use ( async ( ctx , next ) => {
121125 if ( ctx . path . startsWith ( "/interaction/" ) ) {
122- const _uid = ctx . path . split ( "/" ) [ 2 ] ;
123126 const interaction = await oidc . interactionDetails ( ctx . req , ctx . res ) ;
124127
125128 if ( interaction . prompt . name === "login" ) {
0 commit comments