From 61283e721d007a506f38df750d835943a78bf778 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Fri, 28 Jun 2024 08:38:08 -0400 Subject: [PATCH] Simplified logout command --- packages/replayio/src/commands/logout.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/replayio/src/commands/logout.ts b/packages/replayio/src/commands/logout.ts index d7d4c204..d209e210 100644 --- a/packages/replayio/src/commands/logout.ts +++ b/packages/replayio/src/commands/logout.ts @@ -9,13 +9,14 @@ registerCommand("logout").description("Log out of your Replay account").action(l async function logout() { await logoutIfAuthenticated(); - const { accessToken } = await getAccessToken(); - if (accessToken) { - const name = process.env.REPLAY_API_KEY ? "REPLAY_API_KEY" : "RECORD_REPLAY_API_KEY"; - + const { accessToken, apiKeySource } = await getAccessToken(); + if (accessToken && apiKeySource) { console.log( - `You are now signed out but still authenticated via the ${highlight(name)} env variable` + `You have been signed out but you are still authenticated by the ${highlight( + apiKeySource + )} env variable` ); + console.log("You are now signed out"); } else { console.log("You are now signed out"); }