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

Build a configurable UserId service #27

Open
spion opened this issue Apr 13, 2019 · 0 comments
Open

Build a configurable UserId service #27

spion opened this issue Apr 13, 2019 · 0 comments

Comments

@spion
Copy link
Contributor

spion commented Apr 13, 2019

While writing the "Thinking in H4BFF" article, I realized there is no standardized way to get an identifier of the current user in the plugin. It might be nice if we provided this interface built in.

It would have to be configurable by the app though. Something like

this.getSingleton(UserProvider).setProvider(ctx => ctx.getService(MyUserAuthService).id);

Plugins will use this.getService(UserId).userId to fetch the current id, which will simply call the provider.

This will just provide a common unified interface so that you don't have to configure the user provider for each individual plugin. It will still allow you to build or use multiple user authentication implementations, so long as they set up the provider.

Concern: we might need to standardize the userId type to always be an uuid, or at least a string.

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

No branches or pull requests

1 participant