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

How to Programmatically add Formage Users? #109

Open
Plypy opened this issue Jul 16, 2014 · 1 comment
Open

How to Programmatically add Formage Users? #109

Plypy opened this issue Jul 16, 2014 · 1 comment

Comments

@Plypy
Copy link

Plypy commented Jul 16, 2014

Our site have our own admin accounts, we want to let those accounts could access to formage as well.

Is there any API?

@elliottwilliams
Copy link

FWIW, @Plypy and I figured out a way to do this (it is, however, pretty hacky). We grab the FormageUser model from the formage registry, and we overwrite formage.UserForm.encryptSync and formage.UserForm.compareSync with our own password-hashing methods. Then we can create FormageUser docs based on our own user model.

Here's the source as it's implemented in our project: https://github.com/elliottwilliams/openmrs-contrib-id/blob/32159aa90498d96b8e93863aeb54cd12ae1d0502/app/system-modules/db-admin/lib/syncAdminUsers.js

comartmit added a commit to comartmit/formage that referenced this issue Aug 29, 2014
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

2 participants