Maximus upgradus
CodexBar Mobile Build / build-android (push) Failing after 1m38s
CodexBar Mobile Build / release (push) Has been skipped

This commit is contained in:
2026-06-24 20:16:34 +02:00
parent d5b0f9c833
commit ba7d957155
20 changed files with 1192 additions and 642 deletions
+6 -8
View File
@@ -1,5 +1,4 @@
import * as DocumentPicker from "expo-document-picker";
import { File } from "expo-file-system/next";
import type { CodexAuth } from "@/types/codex";
export async function pickAndReadCodexAuth(): Promise<CodexAuth> {
@@ -8,13 +7,11 @@ export async function pickAndReadCodexAuth(): Promise<CodexAuth> {
copyToCacheDirectory: true,
});
if (result.canceled) {
throw new Error("PICKER_CANCELLED");
}
if (result.canceled) throw new Error("PICKER_CANCELLED");
const { uri } = result.assets[0];
const file = new File(uri);
const text = file.text();
const response = await fetch(uri);
const text = await response.text();
let parsed: Record<string, unknown>;
try {
@@ -23,8 +20,9 @@ export async function pickAndReadCodexAuth(): Promise<CodexAuth> {
throw new Error("INVALID_JSON");
}
const accessToken = parsed["accessToken"] as string | undefined;
const accountId = parsed["accountId"] as string | undefined;
const tokens = parsed["tokens"] as Record<string, unknown> | undefined;
const accessToken = (tokens?.["access_token"] ?? parsed["accessToken"]) as string | undefined;
const accountId = (tokens?.["account_id"] ?? parsed["accountId"]) as string | undefined;
if (!accessToken || typeof accessToken !== "string") {
throw new Error("MISSING_ACCESS_TOKEN");