I want to create a centralized login for my apps.
I’m using the MongoDB Atlas free-tier and Reactjs.
I have got various applications and I want to create the same login system for all the apps.
I am thinking in creating a separate cluster that will have configured the email & password provider. The problem is that if I create a custom authentication function I already need another authentication method. No?
Can you inform me about how to do that? Which are the best practises?
Thanks in advance,
Juanjo Asensio García
i don’t understand what you mean by this.
Maybe explain your high level use case and/or work flow first so everyone can understand it better.
The problem is that I don’t know how to write a custom authentication function properly.
I first thought in creating a custom authorization function that:
- Imports Realm-Web as dependency
- Set my separated Login App Service as the Realm App
- Authenticate with the provided email and password in my Login App
- Return the user of Login App if all went OK
But I get the following error:
failed to execute source for 'node_modules/realm-web/dist/bundle.cjs.js': TypeError: Cannot access member 'name' of undefined
at require (native)
Do you know how to fix it?
The app services function engine has some limitations on the dependencies it supports, and it appears that
realm-web is using an unsupported
process call so you cannot use it as a dependency for now. In the meantime, I would recommend using the client API to authenticate the user using this endpoint.
Thank you very much! I have fixed it.
This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.