fix(shared): drop .js extensions from relative imports for Metro
packages/shared/src/index.ts and all sub-modules used .js extensions on relative imports (e.g. './admin/index.js') pointing at .ts source files. TypeScript with moduleResolution: "Bundler" doesn't need them, and Metro's eager exporter (used for preview / production builds) reads them literally and fails — only the dev-server Metro fell back to .ts. Workspace typecheck remains 8/8 green; Vite and TS Bundler resolution already accept both styles, so desktop is unaffected.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { SupportedLocale } from '../i18n/types.js';
|
||||
import type { AppSupabaseClient } from '../supabase/client.js';
|
||||
import type { SupportedLocale } from '../i18n/types';
|
||||
import type { AppSupabaseClient } from '../supabase/client';
|
||||
|
||||
export interface SignupParams {
|
||||
email: string;
|
||||
@@ -58,7 +58,7 @@ export async function loginWithMagicLink(
|
||||
}
|
||||
|
||||
// Parse a callback URL produced by the magic-link email and establish a session.
|
||||
// Works for both PKCE (`?code=…`) and legacy token-hash (`#access_token=…`).
|
||||
// Works for both PKCE (`?code=…`) and legacy token-hash (`#access_token=…`).
|
||||
export async function completeSessionFromUrl(
|
||||
client: AppSupabaseClient,
|
||||
url: string,
|
||||
@@ -91,14 +91,14 @@ export async function completeSessionFromUrl(
|
||||
export async function signOut(client: AppSupabaseClient): Promise<void> {
|
||||
// `scope: 'local'` only ends the session in THIS client. Without it Supabase
|
||||
// defaults to 'global', which invalidates the user's refresh tokens
|
||||
// everywhere — meaning a logout in the browser would also kick the desktop
|
||||
// everywhere — meaning a logout in the browser would also kick the desktop
|
||||
// app (and vice versa) the next time it tries to refresh its token.
|
||||
const { error } = await client.auth.signOut({ scope: 'local' });
|
||||
if (error) throw error;
|
||||
}
|
||||
|
||||
// Verify a 6-digit OTP that arrived via magic-link email. Establishes a
|
||||
// session in the CURRENT webview — no browser redirect involved. Used by the
|
||||
// session in the CURRENT webview — no browser redirect involved. Used by the
|
||||
// desktop/mobile apps where cross-origin redirects don't carry the session
|
||||
// back to the native webview.
|
||||
export async function verifyMagicLinkOtp(
|
||||
|
||||
Reference in New Issue
Block a user