horizon-code 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/app.ts
CHANGED
|
@@ -907,7 +907,8 @@ export class App {
|
|
|
907
907
|
this.authenticated = loggedIn;
|
|
908
908
|
|
|
909
909
|
const cfg = loadConfig();
|
|
910
|
-
const
|
|
910
|
+
const rawEmail = cfg.user_email || getUser()?.email;
|
|
911
|
+
const email = typeof rawEmail === "string" ? rawEmail : undefined;
|
|
911
912
|
|
|
912
913
|
if (!loggedIn) {
|
|
913
914
|
this.splash.setAuthStatus(false);
|
package/src/components/footer.ts
CHANGED
|
@@ -31,7 +31,6 @@ export class InputBar {
|
|
|
31
31
|
width: "100%",
|
|
32
32
|
flexDirection: "column",
|
|
33
33
|
paddingLeft: 4,
|
|
34
|
-
backgroundColor: COLORS.bgSecondary,
|
|
35
34
|
});
|
|
36
35
|
this.acBox.visible = false;
|
|
37
36
|
this.container.add(this.acBox);
|
|
@@ -52,7 +51,6 @@ export class InputBar {
|
|
|
52
51
|
width: "100%",
|
|
53
52
|
flexDirection: "row",
|
|
54
53
|
alignItems: "center",
|
|
55
|
-
backgroundColor: COLORS.bgDarker,
|
|
56
54
|
paddingLeft: 2,
|
|
57
55
|
});
|
|
58
56
|
this.container.add(inputRow);
|
package/src/platform/supabase.ts
CHANGED
|
@@ -214,7 +214,10 @@ export async function loginWithBrowser(): Promise<{ success: boolean; error?: st
|
|
|
214
214
|
// Save everything
|
|
215
215
|
const config = loadConfig();
|
|
216
216
|
saveSessionTokens(config, sd.session.access_token, sd.session.refresh_token);
|
|
217
|
-
|
|
217
|
+
// Defensively extract email — server might return string or object
|
|
218
|
+
const rawEmail = data.email ?? sd.session.user.email ?? sd.session.user?.user_metadata?.email;
|
|
219
|
+
const email = typeof rawEmail === "string" ? rawEmail : typeof rawEmail === "object" && rawEmail !== null ? (rawEmail as any).address ?? (rawEmail as any).email ?? String(rawEmail) : "";
|
|
220
|
+
config.user_email = email;
|
|
218
221
|
config.user_id = sd.session.user.id;
|
|
219
222
|
|
|
220
223
|
if (!config.api_key) {
|
|
@@ -227,7 +230,7 @@ export async function loginWithBrowser(): Promise<{ success: boolean; error?: st
|
|
|
227
230
|
}
|
|
228
231
|
|
|
229
232
|
saveConfig(config);
|
|
230
|
-
return { success: true, email
|
|
233
|
+
return { success: true, email };
|
|
231
234
|
}
|
|
232
235
|
}
|
|
233
236
|
if (res.status === 410) return { success: false, error: "Session expired. Type /login to sign in again." };
|
|
@@ -249,7 +252,8 @@ export async function loginWithPassword(email: string, password: string): Promis
|
|
|
249
252
|
|
|
250
253
|
const config = loadConfig();
|
|
251
254
|
saveSessionTokens(config, data.session.access_token, data.session.refresh_token);
|
|
252
|
-
|
|
255
|
+
const userEmail = data.session.user.email;
|
|
256
|
+
config.user_email = typeof userEmail === "string" ? userEmail : email;
|
|
253
257
|
config.user_id = data.session.user.id;
|
|
254
258
|
|
|
255
259
|
if (!config.api_key) {
|