sourcewizard
Version:
SourceWizard - AI-powered setup wizard for dev tools and libraries with MCP integration
44 lines (43 loc) • 1.2 kB
TypeScript
import { WebAuthOptions } from "./types.js";
import { SupabaseAuthClient } from "@supabase/supabase-js/src/lib/SupabaseAuthClient.js";
export interface AuthStatus {
isAuthenticated: boolean;
user?: {
id: string;
email: string;
};
}
export declare class CLIAuth {
private auth;
private tokenStorage;
constructor(authInstance: SupabaseAuthClient, configDir: string);
/**
* Initialize authentication by restoring session from stored tokens
* Now includes automatic token refresh if tokens are expired
*/
initialize(): Promise<void>;
/**
* Login using web-based authentication
*/
login(options?: WebAuthOptions): Promise<AuthStatus>;
/**
* Logout the current user
*/
logout(): Promise<void>;
/**
* Get current authentication status
* Now uses the automatic token refresh functionality
*/
getStatus(): Promise<AuthStatus>;
/**
* Ensure user is authenticated, throw error if not
*/
requireAuth(): Promise<{
id: string;
email: string;
}>;
/**
* Get current user ID for database operations
*/
getCurrentUserId(): Promise<string>;
}