-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[FEAT] Adding an optional params properties to the Authenticated component so that the useIsAuthenticated and AuthProvider.Check can use the custom params #6309
Comments
Hey @reedwane, thank you for the issue! I think we should definitely have this feature. Do you think having a generic type for the component can improve the DX? Something like below: type CheckParams = { domain: string; };
<Authenticated<CheckParams>
params={{ domain: "refinedev" }}
>
{/* ... */}
</Authenticated>
// Or
const DomainAuthenticated = Authenticated<CheckParams>;
<DomainAuthenticated params={{ domain: "refinedev" }}>{...}</Authenticated> The implementation can be same with the one you've shared. Let us know if you want to work on this, we'll be happy to see your contribution! 🙏 |
Thanks for the feedback @aliemir While I think it'd be nice to have a type, I opine it should be a generic object There might still be other similar use-case for others. |
Hey @reedwane would you like to create a PR for this one? |
@BatuhanW yeah. Lemme see if I can figure how to do that now. Can you please point me to get started |
@reedwane You can start from Also, see our contribution guide It uses |
Is your feature request related to a problem? Please describe.
I am working on a multitenancy app, and my authentication logic requires calling the Auth.check function with some custom properties like the dynamic domain name, so that I can do some required validation
Describe alternatives you've considered
The work around I have for now is to create a local clone of the Authenticated component and made it accept an optional param in its properties, then passed that to the useIsAuthenticated hook in the component.
I think it's simple enough to consider allowing an optional param object be passed, since the Authprovider.check itself readily allows for it
Additional context
Sample usage of my workaround:
Describe the thing to improve
Allow an optional param property on the Authenticated component
The text was updated successfully, but these errors were encountered: