generated from nhcarrigan/template
feat: expose org UUID from claude auth status
This commit is contained in:
@@ -1480,6 +1480,7 @@ pub async fn get_claude_version() -> Result<String, String> {
|
|||||||
pub struct ClaudeAuthStatus {
|
pub struct ClaudeAuthStatus {
|
||||||
pub is_logged_in: bool,
|
pub is_logged_in: bool,
|
||||||
pub email: Option<String>,
|
pub email: Option<String>,
|
||||||
|
pub org_id: Option<String>,
|
||||||
pub org_name: Option<String>,
|
pub org_name: Option<String>,
|
||||||
pub api_key_source: Option<String>,
|
pub api_key_source: Option<String>,
|
||||||
pub api_provider: Option<String>,
|
pub api_provider: Option<String>,
|
||||||
@@ -1510,6 +1511,11 @@ pub async fn get_auth_status() -> Result<ClaudeAuthStatus, String> {
|
|||||||
.and_then(|v| v.as_str())
|
.and_then(|v| v.as_str())
|
||||||
.map(String::from);
|
.map(String::from);
|
||||||
|
|
||||||
|
let org_id = json
|
||||||
|
.get("orgId")
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
|
.map(String::from);
|
||||||
|
|
||||||
let org_name = json
|
let org_name = json
|
||||||
.get("orgName")
|
.get("orgName")
|
||||||
.and_then(|v| v.as_str())
|
.and_then(|v| v.as_str())
|
||||||
@@ -1534,6 +1540,7 @@ pub async fn get_auth_status() -> Result<ClaudeAuthStatus, String> {
|
|||||||
Ok(ClaudeAuthStatus {
|
Ok(ClaudeAuthStatus {
|
||||||
is_logged_in,
|
is_logged_in,
|
||||||
email,
|
email,
|
||||||
|
org_id,
|
||||||
org_name,
|
org_name,
|
||||||
api_key_source,
|
api_key_source,
|
||||||
api_provider,
|
api_provider,
|
||||||
@@ -1550,6 +1557,7 @@ pub async fn get_auth_status() -> Result<ClaudeAuthStatus, String> {
|
|||||||
Ok(ClaudeAuthStatus {
|
Ok(ClaudeAuthStatus {
|
||||||
is_logged_in,
|
is_logged_in,
|
||||||
email: None,
|
email: None,
|
||||||
|
org_id: None,
|
||||||
org_name: None,
|
org_name: None,
|
||||||
api_key_source: None,
|
api_key_source: None,
|
||||||
api_provider: None,
|
api_provider: None,
|
||||||
|
|||||||
@@ -63,6 +63,7 @@
|
|||||||
interface AuthStatus {
|
interface AuthStatus {
|
||||||
is_logged_in: boolean;
|
is_logged_in: boolean;
|
||||||
email: string | null;
|
email: string | null;
|
||||||
|
org_id: string | null;
|
||||||
org_name: string | null;
|
org_name: string | null;
|
||||||
api_key_source: string | null;
|
api_key_source: string | null;
|
||||||
api_provider: string | null;
|
api_provider: string | null;
|
||||||
@@ -320,6 +321,14 @@
|
|||||||
<dd class="text-[var(--text-primary)]">{authStatus.org_name}</dd>
|
<dd class="text-[var(--text-primary)]">{authStatus.org_name}</dd>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if authStatus.org_id}
|
||||||
|
<div class="flex gap-2">
|
||||||
|
<dt class="text-[var(--text-tertiary)] w-20 flex-shrink-0">Org UUID</dt>
|
||||||
|
<dd class="text-[var(--text-secondary)] font-mono text-[10px] break-all">
|
||||||
|
{authStatus.org_id}
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
{#if authStatus.api_key_source}
|
{#if authStatus.api_key_source}
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<dt class="text-[var(--text-tertiary)] w-20 flex-shrink-0">API key</dt>
|
<dt class="text-[var(--text-tertiary)] w-20 flex-shrink-0">API key</dt>
|
||||||
|
|||||||
Reference in New Issue
Block a user