oidc stuff coming across the wire properly and generating a working login URL

This commit is contained in:
Grant Limberg 2021-12-01 13:01:32 -08:00
parent eaccce743f
commit 663a09b38d
No known key found for this signature in database
GPG key ID: 2BA62CCABBB4095A
6 changed files with 26 additions and 15 deletions

View file

@ -156,10 +156,14 @@ pub extern "C" fn zeroidc_auth_info_delete(ptr: *mut AuthInfo) {
#[no_mangle]
pub extern "C" fn zeroidc_get_auth_url(ptr: *mut AuthInfo) -> *const c_char {
if ptr.is_null() {
println!("passed a null object");
return std::ptr::null_mut();
}
let ai = unsafe {
assert!(!ptr.is_null());
&mut *ptr
};
let s = CString::new(ai.url.to_string()).unwrap();
return s.as_ptr();
return s.into_raw();
}