Add error handling for over sso seat limits
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user