]> git.meshlink.io Git - meshlink/blobdiff - src/protocol_auth.c
Modify meshlink configuration base file structre
[meshlink] / src / protocol_auth.c
index d26b0f651f3dde6c374a7dcd49784d998bb6efde..e2fe28b40d972d68a5a8023d5c4cef71045599f0 100644 (file)
@@ -205,7 +205,7 @@ static bool receive_invitation_sptps(void *handle, uint8_t type, const void *dat
 
        config_t config;
 
-       if(!invitation_read(mesh, cookie, &config)) {
+       if(!invitation_read(mesh, "current", cookie, &config, mesh->config_key)) {
                logger(mesh, MESHLINK_ERROR, "Error while trying to read invitation file\n");
                return false;
        }
@@ -238,6 +238,9 @@ static bool receive_invitation_sptps(void *handle, uint8_t type, const void *dat
        // Send the node the contents of the invitation file
        sptps_send_record(&c->sptps, 0, config.buf, config.len);
 
+       config_free(&config);
+       free(submesh_name);
+
        c->status.invitation_used = true;
 
        logger(mesh, MESHLINK_INFO, "Invitation %s successfully sent to %s", cookie, c->name);