khis_has_cred | R Documentation |
This function checks whether valid credentials are available either in the provided auth object or in the global auth credentials object.
khis_has_cred(auth = NULL)
auth |
(Optional) An auth object containing DHIS2 credentials. If not provided, the function will check the global auth object for credentials. |
A boolean value indicating whether valid credentials are available.
Other credential functions:
khis_base_url()
,
khis_cred()
,
khis_cred_clear()
,
khis_display_name()
,
khis_username()
## Not run:
# Set the credentials using global .auth object
khis_cred(username = 'DHIS2 username',
password = 'DHIS2 password',
server = 'https://dhis2-instance/api')
# Check if credentials are available. Should return TRUE
khis_has_cred()
# Clear global credentials
khis_cred_clear()
# Check if credentials are available. Should return FALSE
khis_has_cred()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.