Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geo boundary config for restricted areas #1003

Merged
merged 6 commits into from
Mar 6, 2024
Merged

Conversation

charleslavon
Copy link
Collaborator

@charleslavon charleslavon commented Feb 26, 2024

  • adds a new 1st party cookie, user-country-code
  • prevents near.org access for users from restricted areas
  • includes userCountryCode in product analytics for opted-in users.

closes #1022

Copy link

vercel bot commented Feb 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
near-discovery ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2024 10:47pm
near-discovery-testnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 5, 2024 10:47pm

@charleslavon charleslavon added the enhancement To highlight a PR's description in the 'Enhancements' changelog section label Feb 26, 2024
};

export function middleware(req: NextRequest) {
const country = (req.geo && req.geo.country) || 'UNKNOWN';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super cool! I had no idea Vercel provided req.geo https://nextjs.org/docs/app/api-reference/functions/next-request#geo

@charleslavon charleslavon merged commit fcab0bc into develop Mar 6, 2024
8 checks passed
@charleslavon charleslavon deleted the geo_middleware branch March 6, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement To highlight a PR's description in the 'Enhancements' changelog section
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RudderStack Add Geolocation
2 participants