Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/site/Loopback-component-authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ class.
defaultDecision: AuthorizationDecision.DENY,
};

const binding = app.component(AuthorizationComponent);
app.configure(binding.key).to(options);
app.configure(AuthorizationBindings.COMPONENT).to(options);
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure that configure after component works? On other places we have to do configure before component to make it working?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@derdeka I wasn't sure, so I verified with app in #4571, you can read the PR description to see my testing result.

this.configure() is called in the app constructor, and whenever the authorization interceptor is invoked, the options will be injected. So I believe after app runs, making API calls will inject the configured options.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would like to suggest to switch the order to have it consistent with other docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@derdeka 👌 switched the order to have the configure before mounting component.

app.component(AuthorizationComponent);
```

- The authorization `options` are provided specifically for enforcing the
Expand Down