-
Notifications
You must be signed in to change notification settings - Fork 6
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
Allow using authentication service as a library #22
Comments
Email and avatar are already implemented in other microservices. My suggestion would be to split the code in these layers:
import core from '@clevertech/auth-core'
core.setDatbaseAdapter(dbAdapter)
// API
core.login(...)
core.register(...)
core.forgotPassword(...)
core.resetPassword(...)
core.changePassword(...)
core.confirmEmail(...)
core.enable2FA(...)
core.disable2FA(...)
core.initRecoveryCodes(...)
core.useRecoveryCode(...)
That would be the current implementation split into smaller parts. Then we can implement others: REST, GraphQL, React components, etc. |
@gimenete I like where this is going. Makes sense with auth-core to configure the db layer. Could we further split auth-web? I want the 2fa and the oauth and the recaptcha and the email verification, but I don't want the templates or the routes. I also want parts of the JWT implementation. It makes sense that auth-web puts them all together for ease-of-use. I suspect there is value in having this collection of components mix and matchable as well. Not only for different implementations, but also for ease of maintainence. extensability, and modularity. |
Another thing I missed that can be pluggable is third-party auth systems (facebook, google,...). |
I understand this. That said, the pnp-oauth module I suggest would be for the third-party auth systems that you've mentioned. |
I'd like to pull in the backend and front-end js components separately. I have a GraphQL API and would like to write resolvers that use this service.
What do you think of making a monorepo (pnp-authentication) made up of the following packages:
pnp-autnentication should allow for overiding any of these packages -- there should be a set API that these packages use to communicate, as well as a configure option when initializing the library to override any of the default API with a custom implementation.
Here is one theoretical way we could make this more of a configurable library while still staying true to the plug-and-play nature of the whole thing:
The text was updated successfully, but these errors were encountered: