Skip to content

Commit

Permalink
CLI - Tell users if they're already logged in (#1955)
Browse files Browse the repository at this point in the history
Co-authored-by: Zeke Foppa <[email protected]>
  • Loading branch information
bfops and bfops authored Nov 9, 2024
1 parent ce58e26 commit fdb1a71
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/cli/src/subcommands/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ async fn spacetimedb_token_cached(config: &mut Config, host: &Url, direct_login:
// Currently, this token does not expire. However, it will at some point in the future. When that happens,
// this code will need to happen before any request to a spacetimedb server, rather than at the end of the login flow here.
if let Some(token) = config.spacetimedb_token() {
println!("You are already logged in.");
println!("If you want to log out, use spacetime logout.");
Ok(token.clone())
} else {
let token = if direct_login {
Expand Down

0 comments on commit fdb1a71

Please sign in to comment.