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

Added internal useConfig hook [SDK-2264] #262

Merged
merged 1 commit into from
Jan 29, 2021
Merged

Conversation

Widcket
Copy link
Contributor

@Widcket Widcket commented Jan 29, 2021

Description

If the developer set up their login handler URL to be something other than the default /api/auth/login, then they would have to pass the custom value on every call to withPageAuthRequired.

This PR moves the configuration of custom URLs out of withPageAuthRequired to the UserProvider. Plus it's now also possible to set it with an environment variable that is accessible from the client-side, enabling the developer to just set it once in a single place. This results in an improved developer experience.

Also, it's possible to customize the profile handler URL via an environment variable as well, saving the developer from having to pass it to the UserProvider.

Testing

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

@Widcket Widcket added the review:medium Medium review label Jan 29, 2021
@Widcket Widcket requested a review from a team as a code owner January 29, 2021 01:58
@vercel
Copy link

vercel bot commented Jan 29, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/auth0/nextjs-auth0/9pt9xgt5u
✅ Preview: Canceled

@Widcket Widcket changed the title Add useConfig hook Added useConfig hook [SDK-2264] Jan 29, 2021
@Widcket Widcket changed the title Added useConfig hook [SDK-2264] Added internal useConfig hook [SDK-2264] Jan 29, 2021
@Widcket Widcket merged commit 022931e into beta Jan 29, 2021
@Widcket Widcket deleted the feature/use-config-hook branch January 29, 2021 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review:medium Medium review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants