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

Export client-authentication and user-authentication middlewares #256

Open
rashisf opened this issue Jan 7, 2025 · 2 comments · May be fixed by #257
Open

Export client-authentication and user-authentication middlewares #256

rashisf opened this issue Jan 7, 2025 · 2 comments · May be fixed by #257
Assignees

Comments

@rashisf
Copy link
Contributor

rashisf commented Jan 7, 2025

Description
Currently, the ClientAuthenticationMiddlewareProvider and UserAuthenticationMiddlewareProvider middlewares are not exported.

Though the bindings are created by setting useClientAuthenticationMiddleware and useUserAuthenticationMiddleware to true, they are chained to RestTags.REST_MIDDLEWARE_CHAIN which is the default middlware chain.

The middlewares are not exported and hence custom actions (like defining the middleware chain) cannot be configured onto them.

Describe the solution you'd like
Exposing and exporting these middlewares, one can easily customize and chain these middlewares in their sequences other than the default behavious.

Export them using the index.ts file.

They can be imported and customized.

import {ClientAuthenticationMiddlewareProvider} from 'loopback4-authentication';
...
...
this.middleware(ClientAuthenticationMiddlewareProvider, {
// custom options
chain: MiddlwareChain.PRE_INVOKE
});

@yeshamavani
Copy link
Contributor

@rashisf would you like to contribute

@rashisf
Copy link
Contributor Author

rashisf commented Jan 7, 2025

@rashisf would you like to contribute

Yes

@rashisf rashisf self-assigned this Jan 7, 2025
@rashisf rashisf linked a pull request Jan 7, 2025 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants