Skip to content

v9.2.9 - #433

Merged
vladFrontegg merged 1 commit into
masterfrom
release/next
Aug 7, 2025
Merged

v9.2.9#433
vladFrontegg merged 1 commit into
masterfrom
release/next

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 7, 2025

Copy link
Copy Markdown
Contributor

v9.2.9

🚨 BREAKING CHANGE: Improved IP Handling in Next.js Middleware

Summary

This PR enhances the IP handling capabilities in the Frontegg Next.js middleware by adding support for custom IP resolver functions and improving the priority order for IP resolution.

⚠️ API Method Renamed:

FronteggApiMiddleware.cors() has been renamed to FronteggApiMiddleware.withOptions()
This change affects any existing implementations using the CORS functionality

Migration Required:

// Before (❌ Will break)
export default FronteggApiMiddleware.cors({
  allowedOrigins: ['http://localhost:3000'],
  allowCredentials: true,
});

// After (✅ New syntax)
export default FronteggApiMiddleware.withOptions({
  cors: {
    allowedOrigins: ['http://localhost:3000'],
    allowCredentials: true,
  }
});

New Feature

Added ipResolver parameter to FronteggApiMiddleware.withOptions()
Allows developers to provide custom logic for extracting client IP addresses
Useful for environments with custom proxy setups or non-standard IP headers
Example Usage:

export default FronteggApiMiddleware.withOptions({
  ipResolver: (req) => req.headers['x-your-custom-ip-header']?.toString(),
});

@vladFrontegg
vladFrontegg merged commit 2a8e696 into master Aug 7, 2025
5 checks passed
@github-actions

github-actions Bot commented Aug 7, 2025

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant