sso error handling

This commit is contained in:
Grant Limberg 2022-08-15 14:26:17 -07:00
parent ff670d044a
commit 64a5e0d93f
No known key found for this signature in database
GPG key ID: 8F2F97D3BE8D7735

View file

@ -354,15 +354,21 @@ impl ZeroIDC {
} }
None => { None => {
println!("no id token?!?"); println!("no id token?!?");
(*inner_local.lock().unwrap()).exp_time = 0;
(*inner_local.lock().unwrap()).running = false;
} }
} }
} }
Err(e) => { Err(e) => {
println!("token error: {}", e); println!("token error: {}", e);
(*inner_local.lock().unwrap()).exp_time = 0;
(*inner_local.lock().unwrap()).running = false;
} }
} }
} else { } else {
println!("token response??"); println!("token response??");
(*inner_local.lock().unwrap()).exp_time = 0;
(*inner_local.lock().unwrap()).running = false;
} }
} else { } else {
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
@ -370,6 +376,8 @@ impl ZeroIDC {
} }
} else { } else {
println!("no refresh token?"); println!("no refresh token?");
(*inner_local.lock().unwrap()).exp_time = 0;
(*inner_local.lock().unwrap()).running = false;
} }
sleep(Duration::from_secs(1)); sleep(Duration::from_secs(1));
@ -377,6 +385,7 @@ impl ZeroIDC {
running = (*inner_local.lock().unwrap()).running; running = (*inner_local.lock().unwrap()).running;
} }
} }
// end run loop
println!("thread done!"); println!("thread done!");
(*inner_local.lock().unwrap()).running = false; (*inner_local.lock().unwrap()).running = false;