mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-07-10 07:13:09 -07:00
Add error handling for over sso seat limits
This commit is contained in:
parent
7e46c83592
commit
aee9521c91
4 changed files with 48 additions and 16 deletions
|
@ -267,9 +267,19 @@ pub extern "C" fn zeroidc_token_exchange(idc: *mut ZeroIDC, code: *const c_char
|
|||
|
||||
let code = unsafe{CStr::from_ptr(code)}.to_str().unwrap();
|
||||
|
||||
let ret = idc.do_token_exchange( code);
|
||||
let ret = CString::new(ret).unwrap();
|
||||
return ret.into_raw();
|
||||
let ret = idc.do_token_exchange(code);
|
||||
match ret {
|
||||
Ok(ret) => {
|
||||
let ret = CString::new(ret).unwrap();
|
||||
return ret.into_raw();
|
||||
|
||||
},
|
||||
Err(e) => {
|
||||
let errstr = format!("{{\"message\":\"{}\"\"}}", e).to_string();
|
||||
let ret = CString::new(errstr).unwrap();
|
||||
return ret.into_raw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
|
@ -338,4 +348,4 @@ pub extern "C" fn zeroidc_kick_refresh_thread(idc: *mut ZeroIDC) {
|
|||
};
|
||||
|
||||
idc.kick_refresh_thread();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue