I want to create a new authentication provider that uses our own in-house authentication service. This would be similar to any of the accounts-* (e.g. accounts-password) meteor packages. I’ve found a tutorial on how to create a Meteor package to do this, but I’m not sure the best way to go about incorporating it into Reaction Commerce. Do I need to write an RC plugin that does the same thing as the Meteor package? Or should I somehow include a local Meteor package?
Just to get started, I tried creating a plugin and added the following code to …/custom/myplugin/server/init.js
import { Hooks, Reaction, Logger } from "/server/api";
import { Accounts } from "meteor/accounts-base"
function addINITAuthentication() {
Logger.info("!!! Adding INIT Authentication support !!!");
Accounts.registerLoginHandler("INIT Auth", function(options) {
Logger.info("!!! Called INIT Login handler with options = ", options);
return undefined;
});
}
Hooks.Events.add("afterCoreInit", () => {
addINITAuthentication();
});
I see the first Log message and so it looks like my plugin is correctly registered. However, during login, my login handler is never called.
Thanks!