Beispiel #1
0
def set_passwd(saved_user_obj, new_passwd):
    """
    Sets a new password for a given user object that already exists in the collection
    """
    passwd_hash = gen_passwd_hash(new_passwd, saved_user_obj._id)
    saved_user_obj.passwd_hash = passwd_hash
    saved_user_obj.save()
    return saved_user_obj
Beispiel #2
0
def auth(user_obj, given_password):
    given_pass_hash = gen_passwd_hash(given_password, user_obj.obj_id())
    return user_obj.passwd_hash == given_pass_hash