import json


def get_users(cwd, file_name):
    """Get users and their passwords.

    :param str cwd: current working directory
    :param str file_name: name of the file containing the credentials
    :return: dictionary of users and passwords
    """

    try:
        with open(cwd + '/' + file_name + '.json') as registered_users:
            users = json.load(registered_users)
        return users
    except FileNotFoundError:
        return None