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

Split configuration into Next and Base config #263

Merged
merged 10 commits into from
Feb 1, 2021
Merged

Conversation

adamjmcgrath
Copy link
Contributor

Description

  • separate the config into NextConfig and BaseConfig (I'll come up with a better name when I figure out a better name for auth0-session) to make it easier to supply configuration that applies to the Next layer only (eg custom routes)
  • Removed a bunch of docs and options that were only specific to the express SDK and got inherited by auth0-session

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

@adamjmcgrath adamjmcgrath added the review:medium Medium review label Jan 29, 2021
@adamjmcgrath adamjmcgrath requested a review from a team as a code owner January 29, 2021 14:32
@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/ddpz5pzsw
✅ Preview: Canceled

[Deployment for a52b686 canceled]

* See {@link Config}
* @ignore
*/
export type NextConfig = Pick<BaseConfig, 'routes' | 'identityClaimFilter'>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To add custom routes

export interface NextConfig extends Pick<BaseConfig, 'identityClaimFilter'> {
  routes: {
    postLogoutRedirect: string;
    callback: string;
    login: string;
    logout: string;
  };
}

@adamjmcgrath adamjmcgrath changed the title Split config Split configuration into Next and Base config Jan 29, 2021
Copy link
Contributor

@Widcket Widcket left a comment

Choose a reason for hiding this comment

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

Looks good, just have a question.

login: Joi.alternatives([Joi.string().uri({ relativeOnly: true }), Joi.boolean().valid(false)]).default('/login'),
logout: Joi.alternatives([Joi.string().uri({ relativeOnly: true }), Joi.boolean().valid(false)]).default('/logout'),
callback: Joi.string().uri({ relativeOnly: true }).default('/callback'),
callback: Joi.string().uri({ relativeOnly: true }).required(),
Copy link
Contributor

Choose a reason for hiding this comment

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

The login and logout URLs don't need to be required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed the login and logout URLs from the config as they are not used by auth0-session

@adamjmcgrath adamjmcgrath merged commit c50c5f5 into beta Feb 1, 2021
@adamjmcgrath adamjmcgrath deleted the split-config branch February 1, 2021 14:30
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.

None yet

2 participants