Improve or remove authsome.js and reviewBackend.js
Non-urgent refactoring to get rid of dead code and make things more maintainable.
Ben:
I'm trying to figure out whether authsome.js is dead code. It apparently gets included in the webpack via this super-weird condition in plugins.js (observe that both cases do exactly the same thing). Elsewhere it's only used by ./server/component-xpub-review-backend/src/reviewBackend.js.
reviewBackend
appears to be for sending emails to reviewers and prospective reviewers, but it hasn't had any substantive changes in over 2 years, and the two paths it adds to the app,/api/make-invitation
and/api/make-decision
don't appear to be called from anywhere. This is a bit of a tangled web, but what do you make of it? is this all dead code?
Vignesh (regarding the use of authsome):
did some tests to see if it's a dead code. It seems the pubsweet-server requires these to be passed and cannot ignore them [PFA]. I tried making changes to the
authsome.js
file but it did not reflect or impact anywhere in the app. Did find some documentation on it here - https://www.npmjs.com/package/authsome. It can be used both in server-side and client-side code so it has been added toconfig/default.js
to be utilized by pubsweet-server and in webpack asplugin
. On further looking at the ketida repo it uses authsome similarly to kotahi repo. I feel authsome is not a dead code but is outdated with old logic and not working as it should. It's good to have a word with Yannis or Alexis and then debug/refactor to get it working based on our use case.
This
reviewBackend.js
code seems outdated. The endpoints might have been used previously but it is not needed anymore as we will working on workflow-based notifications in the near future.
(Comments copied from mattermost and !659 (merged))