Example #1
0
static void flush(Dict* args, void* vcontext, String* txid)
{
    struct Context* context = (struct Context*) vcontext;
    // We only remove users which were added using this api.
    CryptoAuth_removeUsers(context->ca, context);
    sendResponse(String_CONST("none"), context->admin, txid);
}
Example #2
0
static void remove(Dict* args, void* vcontext, String* txid, struct Allocator* requestAlloc)
{
    struct Context* context = (struct Context*) vcontext;
    String* user = Dict_getString(args, String_CONST("user"));

    int32_t ret = CryptoAuth_removeUsers(context->ca, user);
    if (ret) {
        sendResponse(String_CONST("none"), context->admin, txid, requestAlloc);
    } else {
        sendResponse(String_CONST("Unknown error."), context->admin, txid, requestAlloc);
    }
}