Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(cursor): usage limits show for accounts signed in through T3 #21228

Closedfcgith(GitHub profile, opens in a new tab)wants to merge 8 commits intomain fromrefs/pull/21228/headopened View on GitHub

Showing 5 changed files with 152 additions and 10 deletions (loading 2).

x
0 of 5 viewed, 5 left
27 additions and 6 deletionspackages/provider-cursor/src/server/auth.tsModified
View file
@@ -29,9 +29,19 @@
fiber?: Fiber.Fiber<void>;
​
+/** A Cursor login saved by T3's browser sign-in, as opposed to a configured API key. */
+export type CursorStoredLogin =
+ | {
+ readonly status: "valid";
+ readonly apiKey: string;
+ readonly backendUrl: string;
+ }
+ | { readonly status: "expired" };
+​
export interface CursorAuth {
readonly controller: ProviderAuthController;
readonly readApiKey: Effect.Effect<string | undefined, ProviderSetupError>;
+ readonly readStoredLogin: Effect.Effect<CursorStoredLogin | undefined, ProviderSetupError>;
readonly requireApiKey: Effect.Effect<string, ProviderSetupError>;
readonly usesApiKey: boolean;
readonly withAccess: <A, E, R>(
@@ -74,8 +84,7 @@
state: { ...current.state, ...patch },
}));
​
- const readApiKey = Effect.gen(function* () {
- if (configuredKey) return configuredKey;
+ const readStoredLogin: CursorAuth["readStoredLogin"] = Effect.gen(function* () {
const credentials = yield* Effect.tryPromise({
try: () => options.store.load(),