refresh token run loop

Need central-side work to complete
This commit is contained in:
Grant Limberg 2021-12-03 15:44:04 -08:00
parent 43c528fdb6
commit 1192b1b422
No known key found for this signature in database
GPG key ID: 2BA62CCABBB4095A
6 changed files with 135 additions and 29 deletions

View file

@ -1,6 +1,6 @@
use std::ffi::{CStr, CString};
use std::os::raw::c_char;
use url::{Url, ParseError};
use url::{Url};
use crate::{AuthInfo, ZeroIDC};
@ -101,23 +101,23 @@ pub extern "C" fn zeroidc_get_exp_time(ptr: *mut ZeroIDC) -> u64 {
id.get_exp_time()
}
#[no_mangle]
pub extern "C" fn zeroidc_process_form_post(ptr: *mut ZeroIDC, body: *const c_char) -> bool {
let idc = unsafe {
assert!(!ptr.is_null());
&mut *ptr
};
// #[no_mangle]
// pub extern "C" fn zeroidc_process_form_post(ptr: *mut ZeroIDC, body: *const c_char) -> bool {
// let idc = unsafe {
// assert!(!ptr.is_null());
// &mut *ptr
// };
if body.is_null() {
println!("body is null");
return false
}
// if body.is_null() {
// println!("body is null");
// return false
// }
let body = unsafe { CStr::from_ptr(body) }
.to_str().unwrap().to_string();
// let body = unsafe { CStr::from_ptr(body) }
// .to_str().unwrap().to_string();
false
}
// false
// }
#[no_mangle]
pub extern "C" fn zeroidc_get_auth_info(