diff --git a/src/rest/api/api_network.lua b/src/rest/api/api_network.lua index 3ad48ae..e2b5936 100644 --- a/src/rest/api/api_network.lua +++ b/src/rest/api/api_network.lua @@ -1,8 +1,10 @@ +local log = require('util.logger') local settings = require('util.settings') local utils = require('util.utils') local netconf = require('network.netconfig') local wifi = require('network.wlanconfig') local ResponseClass = require('rest.response') +local signin = require('network.signin') local M = { isApi = true @@ -108,10 +110,12 @@ function M.associate_POST(request, response) return end - local associate = function() - local rv,msg = netconf.associateSsid(argSsid, argPhrase, argRecreate) + local associate = function() + local rv,msg = netconf.associateSsid(argSsid, argPhrase, argRecreate) end - response:addPostResponseFunction(associate) + response:addPostResponseFunction(associate) + + --[[local helloA = function() local log = require('util.logger') @@ -172,4 +176,15 @@ function M.remove_POST(request, response) end end +function M.signin(request, response) + log:info("API:Network:signin") + if signin.signin() then + log:info("API:Network:signed in") + response:setSuccess("API:Network:signed in") + else + log:info("API:Network:Signing in failed") + response:setError("Signing in failed") + end +end + return M