Closed era127 closed 1 year ago
Hi @rdavis120 both of those struct implement Default
meaning if the keys are not in the json, they will deserialize to empty Strings. They will not make your application crash and you should still be able to catch that you're not authed
Ok. Are you ok with changing the return to AuthStatus?
Not sure I understand what you mean
Just to change:
pub async fn check_auth_status(&self) -> Result<Value, reqwest::Error> {
To:
pub async fn check_auth_status(&self) -> Result<AuthStatus, reqwest::Error> {
Sure, I must have forgotten
The message and server_info fields would not be present if the session is not authenticated and tickle is called. I would propose making them serde default or Option<>.
I also would propose using the same AuthStatus as the return type of
pub async fn check_auth_status(&self)
instead ofValue
.Please let me know if this would break your functionality.