Can get Central JSON bundle back to zerotier-one window
This commit is contained in:
parent
1375e3e2f5
commit
2293b0703f
5 changed files with 69 additions and 37 deletions
|
@ -310,13 +310,13 @@ public:
|
|||
return "";
|
||||
}
|
||||
|
||||
void doTokenExchange(const char *code) {
|
||||
const char* doTokenExchange(const char *code) {
|
||||
if (_idc == nullptr) {
|
||||
fprintf(stderr, "ainfo or idc null\n");
|
||||
return;
|
||||
return "";
|
||||
}
|
||||
|
||||
zeroidc::zeroidc_token_exchange(_idc, code);
|
||||
const char *ret = zeroidc::zeroidc_token_exchange(_idc, code);
|
||||
zeroidc::zeroidc_set_nonce_and_csrf(
|
||||
_idc,
|
||||
_config.ssoState,
|
||||
|
@ -326,6 +326,7 @@ public:
|
|||
const char* url = zeroidc::zeroidc_get_auth_url(_idc);
|
||||
memcpy(_config.authenticationURL, url, strlen(url));
|
||||
_config.authenticationURL[strlen(url)] = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint64_t getExpiryTime() {
|
||||
|
@ -1674,7 +1675,7 @@ public:
|
|||
if (_nets.find(id) != _nets.end()) {
|
||||
NetworkState& ns = _nets[id];
|
||||
const char* code = zeroidc::zeroidc_get_url_param_value("code", path.c_str());
|
||||
ns.doTokenExchange(code);
|
||||
res = json::parse(ns.doTokenExchange(code));
|
||||
scode = 200;
|
||||
} else {
|
||||
scode = 404;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue