-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
refactor: flatten project config and make arguments optional #236
Conversation
BREAKING CHANGES: The configuration `OryClientConfiguration` has changed. Everything previously under the `project` key is now at the root level and optional: ```patch { sdk: { ... }, - project: { - registration_enabled: true, - ... - } registration_enabled: true, ... } ```
@@ -89,7 +89,7 @@ export function OryTwoStepCard() { | |||
{step === ProcessStep.ChooseAuthMethod && ( | |||
<> | |||
{flowType === FlowType.Login && ( | |||
<BackButton href={config.project.login_ui_url} /> | |||
<BackButton href={config.login_ui_url ?? '/login'} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should make assumptions about the library setup here. If we do, this will cause unexpected behavior for customers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm ok, but it kinda sucks that I have to define all of these values when I want to use the SDK
* | ||
* Defaults to true. | ||
*/ | ||
registration_enabled?: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should all be required, because otherwise we have another layer of defaults in the Ory Network stack.
One possible improvement is, to make it possible for the library to "auto discover" these values from the project's API endpoints, so that you don't need to pass them in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I see. But then the user has to keep those in sync? So I assume we need an endpoint for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have an endpoint for it, but it's internal only for now.
We can expose it, though, and that was the plan. Just need to make sure it doesn't expose anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think we should solve this for the release, otherwise it's really cumbersome to set up. And then it should be removed from the config in my view as we would just use the SDK URL to fetch the data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think we should solve this for the release, otherwise it's really cumbersome to set up.
But it's just a one time setup, where we can provide a copy & pasteable snippet. I don't think it's that critical.
And we should still provide the option to override all of these settings manually, for local dev or feature flags.
BREAKING CHANGES: The configuration
OryClientConfiguration
has changed. Everything previously under theproject
key is now at the root level and optional:Related Issue or Design Document
Checklist
If this pull request addresses a security vulnerability,
I confirm that I got approval (please contact [email protected]) from the maintainers to push the changes.
Further comments