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

Add support for configuring the built-in handlers [SDK-3566] #826

Closed
wants to merge 6 commits into from

Conversation

Widcket
Copy link
Contributor

@Widcket Widcket commented Sep 22, 2022

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

📋 Changes

Currently it's not possible to dynamically configure the built-in handlers. For example, to pass a connection parameter to the login handler, it's necessary to override it.

Before

export default handleAuth({
  async login(req, res) {
    try {
      await handleLogin(req, res, {
        authorizationParams: {
          connection: 'github'
        },
      });
    } catch (error) {
      // ...
    }
  }
});

This PR allows to pass option objects to configure the built-in handlers, without having to override them.

After

export default handleAuth({
  login: {
    authorizationParams: {
      connection: 'github'
    }
  }
});

It's still possible to override the built-in handlers by passing custom handler functions.

🎯 Testing

Besides adding unit tests, this change was tested manually in the kitchen sink example app.

@Widcket Widcket added the review:small Small review label Sep 22, 2022
@Widcket Widcket requested a review from a team as a code owner September 22, 2022 06:10
@vercel
Copy link

vercel bot commented Sep 22, 2022

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

1 Ignored Deployment
Name Status Preview Updated
nextjs-auth0 ⬜️ Ignored (Inspect) Sep 22, 2022 at 6:41AM (UTC)

@Widcket Widcket added review:medium Medium review and removed review:small Small review labels Sep 22, 2022
@Widcket Widcket added review:small Small review and removed review:medium Medium review labels Sep 22, 2022
@Widcket Widcket added review:medium Medium review and removed review:small Small review labels Sep 22, 2022
@adamjmcgrath
Copy link
Contributor

Closing, as we're going in a different direction with this

@adamjmcgrath adamjmcgrath mentioned this pull request Nov 30, 2022
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