TypeScript interfaces for managing OAuth device authorization flows and polling tokens. Reuse when implementing CLI authentication mechanisms.
// Source: https://github.com/TonyStef/Grov | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
/**
* Auth types - device authorization flow for CLI
* Aligns with Supabase device_codes table
*/
// Device code record in database
export interface DeviceCode {
id: string;
device_code: string;
user_code: string;
user_id: string | null;
authorized: boolean;
expires_at: string;
created_at: string;
}
// Response when starting device flow
export interface DeviceFlowStartResponse {
device_code: string;
user_code: string;
verification_uri: string;
expires_in: number;
interval: number;
}
// Request when polling for token
export interface DeviceFlowPollRequest {
de
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key