Skip to content

Conversation

guabu
Copy link
Contributor

@guabu guabu commented Jul 14, 2025

📋 Changes

Adds support for withApiAuthRequired helper.

📎 References

Fixes: #1790

🎯 Testing

Set up an API route as documented in EXAMPLES.md to observe the 401 when unauthenticated and the successful 200 response when a session exists.

@guabu guabu requested a review from a team as a code owner July 14, 2025 14:09
Copy link
Contributor

@tusharpandey13 tusharpandey13 left a comment

Choose a reason for hiding this comment

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

lgtm

@tusharpandey13 tusharpandey13 merged commit 35257e4 into auth0:main Jul 17, 2025
10 of 11 checks passed
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 56.52174% with 30 lines in your changes missing coverage. Please review.

Project coverage is 84.39%. Comparing base (4e3a2fe) to head (e2a3ff2).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/server/client.ts 4.00% 24 Missing ⚠️
src/utils/request.ts 16.66% 5 Missing ⚠️
src/server/helpers/with-api-auth-required.ts 97.36% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2230      +/-   ##
==========================================
- Coverage   85.01%   84.39%   -0.62%     
==========================================
  Files          24       26       +2     
  Lines        2309     2378      +69     
  Branches      429      442      +13     
==========================================
+ Hits         1963     2007      +44     
- Misses        340      365      +25     
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tusharpandey13 tusharpandey13 mentioned this pull request Aug 1, 2025
@mickaeltr
Copy link

Hello, I couldn't find out how to use withApiAuthRequired as it does not seem to be available for import from @auth0/nextjs-auth0 or else (like any other function). Perhaps I misunderstood or something is missing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v4 - replacements for with_____Required methods?
4 participants