Skip to content

Commit

Permalink
Add check for missing broker in auth_loop, suspend if absent
Browse files Browse the repository at this point in the history
  • Loading branch information
nullchinchilla committed Mar 28, 2024
1 parent 1e70d7f commit 6892373
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions binaries/geph5-client/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ pub async fn get_connect_token(
}

pub async fn auth_loop(ctx: &AnyCtx<Config>) -> anyhow::Result<()> {
if ctx.init().broker.is_none() {
return smol::future::pending().await;
}
// Dummy authentication for now!
let auth_token = if let Some(token) = db_read(ctx, "auth_token").await? {
String::from_utf8_lossy(&token).to_string()
Expand Down

0 comments on commit 6892373

Please sign in to comment.