Skip to content

Commit f4fb8ee

Browse files
committed
Handle logged out
1 parent a6648b3 commit f4fb8ee

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/api/providers/roo.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ export class RooHandler extends BaseOpenAiCompatibleProvider<RooModelId> {
3838
if (state.state === "active-session") {
3939
this.client = new OpenAI({
4040
baseURL: this.baseURL,
41-
apiKey: this.options.apiKey,
41+
apiKey: CloudService.instance.authService?.getSessionToken() ?? "unauthenticated",
42+
defaultHeaders: DEFAULT_HEADERS,
43+
})
44+
} else if (state.state === "logged-out") {
45+
this.client = new OpenAI({
46+
baseURL: this.baseURL,
47+
apiKey: "unauthenticated",
4248
defaultHeaders: DEFAULT_HEADERS,
4349
})
4450
}

0 commit comments

Comments
 (0)