We are working on enabling bahmni appointments to run on OpenMRS. This application leverages logged-in user’s username. It sets the current logged-in username in the cookies and uses it later.
This works for all the users but the admin user. We see that admin user doesn’t have a username and the cookie is set to null. We checked out on bahmni-demo and found out that the username for admin is populated but not on OpenMRS Demo.
Any specific reason why the admin user doesn’t have a username?
@dkayiwa, We don’t have hold of the user java object. We are using the session api /openmrs/ws/rest/v1/session?v=custom:(uuid,username) to figure out if the session is valid and to get the logged-in user’s username.
Now while it works for all the other users, for admin we get it as null. The reason for this is that the admin user doesn’t have username populated in the database. We wanted to know why the admin user doesn’t get a username.
I can create a card and raise a PR. Just help me understand one thing though, since it is a change-set ideally, I should create a new change-set where I populate this specific value. Unless openmrs have some guidelines to edit the existing changeset with validChecksum.
Yes you can always create one if it does not exist. Correct, it would not be part of the platform 2.3 release. If you plan to backport it to 2.3, then you can put it in the liquibase-update-to-2.3.xml file.