File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -167,8 +167,9 @@ export function setupAuthServer(options: SetupAuthServerOptions): void {
167167 authApp . get ( '/.well-known/oauth-authorization-server' , cors ( ) , toNodeHandler ( oAuthDiscoveryMetadata ( auth ) ) ) ;
168168
169169 // Body parsers for non-better-auth routes (like /sign-in)
170- authApp . use ( express . json ( ) ) ;
171- authApp . use ( express . urlencoded ( { extended : true } ) ) ;
170+ const maxBodyBytes = 100 * 1024 ; // Make the default explicit to avoid accidental large-body DoS.
171+ authApp . use ( express . json ( { limit : maxBodyBytes } ) ) ;
172+ authApp . use ( express . urlencoded ( { extended : true , limit : maxBodyBytes } ) ) ;
172173
173174 // Auto-login page that creates a real better-auth session
174175 // This simulates a user logging in and approving the OAuth request
You can’t perform that action at this time.
0 commit comments