@fayz-ai/auth 0.44.0 → 0.48.0
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/README.md +4 -0
- package/dist/chunk-2MO4QTQA.js +78 -0
- package/dist/chunk-2MO4QTQA.js.map +1 -0
- package/dist/chunk-2S7KVJQO.js +18 -0
- package/dist/chunk-2S7KVJQO.js.map +1 -0
- package/dist/chunk-4HVM2UJS.js +30 -0
- package/dist/chunk-4HVM2UJS.js.map +1 -0
- package/dist/chunk-55RFOMW5.js +15 -0
- package/dist/chunk-55RFOMW5.js.map +1 -0
- package/dist/chunk-7JYNJQJJ.js +138 -0
- package/dist/chunk-7JYNJQJJ.js.map +1 -0
- package/dist/chunk-BGCCXJJA.js +174 -0
- package/dist/chunk-BGCCXJJA.js.map +1 -0
- package/dist/chunk-CV4LQYNX.js +109 -0
- package/dist/chunk-CV4LQYNX.js.map +1 -0
- package/dist/chunk-ERIPMYL2.js +137 -0
- package/dist/chunk-ERIPMYL2.js.map +1 -0
- package/dist/chunk-HKILBDG2.js +158 -0
- package/dist/chunk-HKILBDG2.js.map +1 -0
- package/dist/chunk-KLQDHFVS.js +11 -0
- package/dist/chunk-KLQDHFVS.js.map +1 -0
- package/dist/chunk-OI74ER2Z.js +31 -0
- package/dist/chunk-OI74ER2Z.js.map +1 -0
- package/dist/chunk-Q6DFI35B.js +187 -0
- package/dist/chunk-Q6DFI35B.js.map +1 -0
- package/dist/chunk-QJRTW7Q3.js +90 -0
- package/dist/chunk-QJRTW7Q3.js.map +1 -0
- package/dist/chunk-REU4D5UF.js +44 -0
- package/dist/chunk-REU4D5UF.js.map +1 -0
- package/dist/chunk-SMFXGZN7.js +18 -0
- package/dist/chunk-SMFXGZN7.js.map +1 -0
- package/dist/chunk-W35GQEGU.js +80 -0
- package/dist/chunk-W35GQEGU.js.map +1 -0
- package/dist/chunk-W7565FXD.js +64 -0
- package/dist/chunk-W7565FXD.js.map +1 -0
- package/dist/chunk-WZVZMNLB.js +48 -0
- package/dist/chunk-WZVZMNLB.js.map +1 -0
- package/dist/components/AmbassadorBubbles.d.ts +9 -0
- package/dist/components/AmbassadorBubbles.d.ts.map +1 -0
- package/dist/components/AmbassadorBubbles.js +3 -0
- package/dist/components/AmbassadorBubbles.js.map +1 -0
- package/dist/components/TrialPromise.d.ts +12 -0
- package/dist/components/TrialPromise.d.ts.map +1 -0
- package/dist/components/TrialPromise.js +3 -0
- package/dist/components/TrialPromise.js.map +1 -0
- package/dist/components/form-classes.d.ts +3 -0
- package/dist/components/form-classes.d.ts.map +1 -0
- package/dist/components/form-classes.js +3 -0
- package/dist/components/form-classes.js.map +1 -0
- package/dist/context.js +5 -0
- package/dist/context.js.map +1 -0
- package/dist/data/mock.d.ts.map +1 -0
- package/dist/data/mock.js +3 -0
- package/dist/data/mock.js.map +1 -0
- package/dist/data/supabase.d.ts.map +1 -0
- package/dist/data/supabase.js +4 -0
- package/dist/data/supabase.js.map +1 -0
- package/dist/domain/auth-config.d.ts +71 -0
- package/dist/domain/auth-config.d.ts.map +1 -0
- package/dist/domain/auth-config.js +3 -0
- package/dist/domain/auth-config.js.map +1 -0
- package/dist/domain/auth-link.d.ts +26 -0
- package/dist/domain/auth-link.d.ts.map +1 -0
- package/dist/domain/auth-link.js +3 -0
- package/dist/domain/auth-link.js.map +1 -0
- package/dist/domain/password.d.ts +5 -0
- package/dist/domain/password.d.ts.map +1 -0
- package/dist/domain/password.js +3 -0
- package/dist/domain/password.js.map +1 -0
- package/dist/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -573
- package/dist/index.js.map +1 -1
- package/dist/lib/runtime.d.ts +6 -0
- package/dist/lib/runtime.d.ts.map +1 -0
- package/dist/lib/runtime.js +51 -0
- package/dist/lib/runtime.js.map +1 -0
- package/dist/lib/url-intent.d.ts +1 -25
- package/dist/lib/url-intent.d.ts.map +1 -1
- package/dist/lib/url-intent.js +3 -0
- package/dist/lib/url-intent.js.map +1 -0
- package/dist/store.js +3 -0
- package/dist/store.js.map +1 -0
- package/dist/views/AuthCallbackPage.d.ts +7 -0
- package/dist/views/AuthCallbackPage.d.ts.map +1 -0
- package/dist/views/AuthCallbackPage.js +33 -0
- package/dist/views/AuthCallbackPage.js.map +1 -0
- package/dist/views/AuthGate.d.ts +9 -0
- package/dist/views/AuthGate.d.ts.map +1 -0
- package/dist/views/AuthGate.js +28 -0
- package/dist/views/AuthGate.js.map +1 -0
- package/dist/views/ForgotPasswordForm.d.ts +18 -0
- package/dist/views/ForgotPasswordForm.d.ts.map +1 -0
- package/dist/views/ForgotPasswordForm.js +7 -0
- package/dist/views/ForgotPasswordForm.js.map +1 -0
- package/dist/views/LoginForm.d.ts +16 -0
- package/dist/views/LoginForm.d.ts.map +1 -0
- package/dist/views/LoginForm.js +8 -0
- package/dist/views/LoginForm.js.map +1 -0
- package/dist/views/LoginPage.d.ts +34 -0
- package/dist/views/LoginPage.d.ts.map +1 -0
- package/dist/views/LoginPage.js +16 -0
- package/dist/views/LoginPage.js.map +1 -0
- package/dist/views/OAuthButtons.d.ts +18 -0
- package/dist/views/OAuthButtons.d.ts.map +1 -0
- package/dist/views/OAuthButtons.js +7 -0
- package/dist/views/OAuthButtons.js.map +1 -0
- package/dist/views/ResetPasswordForm.d.ts +6 -0
- package/dist/views/ResetPasswordForm.d.ts.map +1 -0
- package/dist/views/ResetPasswordForm.js +53 -0
- package/dist/views/ResetPasswordForm.js.map +1 -0
- package/dist/views/ResetPasswordPage.d.ts +7 -0
- package/dist/views/ResetPasswordPage.d.ts.map +1 -0
- package/dist/views/ResetPasswordPage.js +16 -0
- package/dist/views/ResetPasswordPage.js.map +1 -0
- package/dist/views/SetPasswordPage.d.ts +15 -0
- package/dist/views/SetPasswordPage.d.ts.map +1 -0
- package/dist/views/SetPasswordPage.js +9 -0
- package/dist/views/SetPasswordPage.js.map +1 -0
- package/dist/views/SignupForm.d.ts +24 -0
- package/dist/views/SignupForm.d.ts.map +1 -0
- package/dist/views/SignupForm.js +9 -0
- package/dist/views/SignupForm.js.map +1 -0
- package/dist/views/VerifyEmailNotice.d.ts +15 -0
- package/dist/views/VerifyEmailNotice.d.ts.map +1 -0
- package/dist/views/VerifyEmailNotice.js +6 -0
- package/dist/views/VerifyEmailNotice.js.map +1 -0
- package/dist/views/usePasswordSetupGate.d.ts +20 -0
- package/dist/views/usePasswordSetupGate.d.ts.map +1 -0
- package/dist/views/usePasswordSetupGate.js +27 -0
- package/dist/views/usePasswordSetupGate.js.map +1 -0
- package/package.json +14 -3
- package/dist/adapters/mock.d.ts.map +0 -1
- package/dist/adapters/supabase.d.ts.map +0 -1
- /package/dist/{adapters → data}/mock.d.ts +0 -0
- /package/dist/{adapters → data}/supabase.d.ts +0 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/url-intent.ts","../src/adapters/supabase.ts","../src/adapters/mock.ts","../src/store.ts","../src/context.tsx"],"names":[],"mappings":";;;;;;;;;AA2BO,IAAM,iBAAA,GAAoB;AAIjC,IAAM,UAAA,GAAa,sBAAA;AAQnB,SAAS,QAAA,GAA+B;AAMtC,EAAA,MAAM,GAAA,GAAM,OAAO,MAAA,KAAW,WAAA,GAAc,SAAY,MAAA,CAAO,QAAA;AAC/D,EAAA,IAAI,CAAC,KAAK,OAAO,IAAA;AACjB,EAAA,OAAO;AAAA,IACL,QAAA,EAAU,IAAI,QAAA,IAAY,EAAA;AAAA,IAC1B,MAAA,EAAQ,IAAI,MAAA,IAAU,EAAA;AAAA,IACtB,IAAA,EAAM,IAAI,IAAA,IAAQ;AAAA,GACpB;AACF;AAGA,IAAM,aAAiC,QAAA,EAAS;AAIhD,SAAS,WAAW,IAAA,EAA+B;AACjD,EAAA,MAAM,GAAA,GAAM,IAAA,CAAK,OAAA,CAAQ,IAAA,EAAM,EAAE,CAAA;AACjC,EAAA,IAAI,CAAC,OAAO,CAAC,GAAA,CAAI,SAAS,GAAG,CAAA,EAAG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;AAE/F,EAAA,OAAO;AAAA,IACL,IAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,eAAA;AAAA,IACA,KAAA;AAAA,IACA,mBAAA;AAAA,IACA,QAAQ,GAAA,CAAI,MAAA;AAAA,IACZ,QAAQ,GAAA,CAAI,MAAA;AAAA,IACZ,SAAS,GAAA,CAAI,OAAA;AAAA,IACb,iBAAiB,GAAA,CAAI,eAAA;AAAA,IACrB,eAAe,GAAA,CAAI,aAAA;AAAA,IACnB,gBAAgB,GAAA,CAAI,cAAA;AAAA,IACpB,gBAAgB,GAAA,CAAI,cAAA;AAAA,IACpB,YAAY,GAAA,CAAI,UAAA;AAAA,IAChB,oBAAoB,GAAA,CAAI,kBAAA;AAAA,IACxB,0BAA0B,GAAA,CAAI;AAAA,GAChC;AACF","file":"index.js","sourcesContent":["// ---------------------------------------------------------------------------\n// Auth link intent — what the URL the user just arrived on is asking for.\n//\n// A Supabase recovery / magic link lands on the app with the tokens in the URL\n// FRAGMENT (implicit flow is the supabase-js default), e.g.\n//\n// https://app.example.com/#access_token=…&refresh_token=…&type=recovery\n//\n// GoTrue then consumes that fragment and wipes it (`window.location.hash = ''`)\n// as soon as the client initialises — so by the time React renders, the reason\n// the user is here is gone. Hence the module-load snapshot: this file is\n// imported long before any createClient() call, so it always sees the original\n// URL.\n//\n// Errors arrive the same way, without a `type`:\n//\n// https://app.example.com/#error=access_denied&error_code=otp_expired&…\n// ---------------------------------------------------------------------------\n\nexport type AuthUrlIntent =\n /** A password-recovery link — the user must choose a new password now. */\n | { kind: 'recovery' }\n /** A one-time link that was already used or has expired. */\n | { kind: 'expired'; message?: string }\n\n/** Query param apps can put on their own redirect URLs to force the\n * set-password screen (e.g. when they override `resetPasswordUrl`). */\nexport const AUTH_INTENT_PARAM = 'fayz_auth'\n\n/** Path segment the SDK historically used as the reset-password redirect.\n * Still honoured so apps that configured it keep working. */\nconst RESET_PATH = '/auth/reset-password'\n\ninterface UrlSnapshot {\n pathname: string\n search: string\n hash: string\n}\n\nfunction snapshot(): UrlSnapshot | null {\n // `window` without a `location` is a real environment, not a hypothetical:\n // the SSR shim the manifest derivation runs under defines the global and not\n // the URL. This module is imported at the top of the auth context, so it is\n // evaluated anywhere the context is — including there, where reading\n // `window.location.pathname` threw and took the whole derivation with it.\n const loc = typeof window === 'undefined' ? undefined : window.location\n if (!loc) return null\n return {\n pathname: loc.pathname ?? '',\n search: loc.search ?? '',\n hash: loc.hash ?? '',\n }\n}\n\n/** Taken at import time — before any Supabase client can strip the fragment. */\nconst initialUrl: UrlSnapshot | null = snapshot()\n\n/** The fragment can be either auth params (`access_token=…&type=recovery`) or a\n * hash-router path (`#/dashboard`). Only the former parses into pairs. */\nfunction hashParams(hash: string): URLSearchParams {\n const raw = hash.replace(/^#/, '')\n if (!raw || !raw.includes('=')) return new URLSearchParams()\n return new URLSearchParams(raw)\n}\n\nexport function readAuthUrlIntent(url?: UrlSnapshot | null): AuthUrlIntent | null {\n const loc = url ?? initialUrl\n if (!loc) return null\n\n const query = new URLSearchParams(loc.search)\n const hash = hashParams(loc.hash)\n const param = (key: string) => hash.get(key) ?? query.get(key)\n\n const errorCode = param('error_code') ?? param('error')\n const errorDescription = param('error_description')?.replace(/\\+/g, ' ')\n // A dead one-time link (`error_code=otp_expired`). Deliberately narrow: an\n // OAuth `access_denied` is a different failure and must not land here. GoTrue\n // does not echo `type` on error redirects, so recovery and invite links are\n // indistinguishable at this point — the screen offers a fresh link either way.\n if (errorCode && /otp|expired|link/i.test(`${errorCode} ${errorDescription ?? ''}`)) {\n return { kind: 'expired', message: errorDescription ?? undefined }\n }\n\n const marker = query.get(AUTH_INTENT_PARAM)\n const type = param('type')\n if (type === 'recovery' || marker === 'recovery') return { kind: 'recovery' }\n\n // `/auth/reset-password` with no tokens at all: the user opened the reset URL\n // directly, or the tokens were already consumed by a previous page load.\n const path = loc.pathname.replace(/\\/+$/, '')\n if (path.endsWith(RESET_PATH)) return { kind: 'recovery' }\n\n return null\n}\n\n// ---------------------------------------------------------------------------\n// App handoff — arriving from a sibling application already signed in.\n//\n// The products share one Supabase project now, so the same person is one\n// `auth.users` row across all of them. They do NOT share a session: each app is\n// its own origin, and supabase-js keeps the session in that origin's\n// localStorage. Same account, same database, and still a password prompt — which\n// is the friction the switcher exists to remove.\n//\n// So the switcher carries the session over in the URL FRAGMENT, which is the\n// same channel GoTrue's own magic links use and for the same reason: a fragment\n// is never sent to a server, never reaches an access log, and never lands in a\n// Referer header. The module-load snapshot above is what makes reading it\n// reliable — supabase-js wipes the hash as soon as it initialises.\n//\n// Two things keep this from being a hole, and both are required:\n//\n// • The DESTINATION only adopts a handoff whose tokens actually verify — it\n// calls setSession, so a forged fragment fails at GoTrue, not at us.\n// • The SOURCE only ever writes this fragment to an origin listed in\n// `app.apps.url`. A tile is not a free-form link.\n//\n// The honest alternative is one origin with paths per app (/app/resto,\n// /app/loja), where localStorage is shared and no token travels at all. That is\n// a deployment change, and this is the same result without one.\n// ---------------------------------------------------------------------------\n\n/**\n * Fragment keys carrying a sibling app's session.\n *\n * Two keys and not one packed value: a JWT is `header.payload.signature`, so\n * any separator that looked natural — a dot above all — also occurs inside the\n * access token. Packing them cost an afternoon and produced `Invalid JWT\n * structure` at the far end, which reads like a forged token rather than like a\n * string that was cut in the wrong place. Both keys are required, so a\n * half-copied fragment is still a miss.\n */\nexport const APP_HANDOFF_PARAM = 'handoff'\nexport const APP_HANDOFF_REFRESH_PARAM = 'handoff_r'\n/** Fragment key naming the account to land in, so the arrival is not a guess. */\nexport const APP_HANDOFF_TENANT_PARAM = 'account'\n\nexport interface AppHandoff {\n accessToken: string\n refreshToken: string\n /** Which account the user was looking at. Null means \"whichever you'd pick\". */\n tenantId: string | null\n}\n\n/**\n * The session a sibling app handed over, if this page load is such an arrival.\n *\n * Returns null for every ordinary load, which is the overwhelming majority —\n * so a caller can ask on every boot without paying for it.\n */\nexport function readAppHandoff(url?: UrlSnapshot | null): AppHandoff | null {\n const loc = url ?? initialUrl\n if (!loc) return null\n\n const hash = hashParams(loc.hash)\n const accessToken = hash.get(APP_HANDOFF_PARAM)\n const refreshToken = hash.get(APP_HANDOFF_REFRESH_PARAM)\n if (!accessToken || !refreshToken) return null\n\n return {\n accessToken,\n refreshToken,\n tenantId: hash.get(APP_HANDOFF_TENANT_PARAM) || null,\n }\n}\n\n/** Pack a session into the fragment the destination will read. */\nexport function buildAppHandoffUrl(\n appUrl: string,\n session: { accessToken: string; refreshToken: string },\n tenantId?: string | null,\n): string {\n if (!session.accessToken || !session.refreshToken) return appUrl\n const params = new URLSearchParams()\n params.set(APP_HANDOFF_PARAM, session.accessToken)\n params.set(APP_HANDOFF_REFRESH_PARAM, session.refreshToken)\n if (tenantId) params.set(APP_HANDOFF_TENANT_PARAM, tenantId)\n // The hash is replaced, not appended to: an app URL that already carries a\n // hash-router path would otherwise arrive with both, and neither would parse.\n const base = appUrl.split('#')[0]\n return `${base}#${params.toString()}`\n}\n\n/** Strip auth leftovers from the address bar once the flow is finished, so a\n * reload does not put the user back on the set-password screen (and so the\n * hash router gets a clean slate). */\nexport function clearAuthUrlTokens(): void {\n if (typeof window === 'undefined') return\n const url = new URL(window.location.href)\n url.searchParams.delete(AUTH_INTENT_PARAM)\n if (url.hash.includes('=')) url.hash = ''\n window.history.replaceState(window.history.state, '', url.toString())\n}\n\n/** Add the intent marker to a redirect URL. Absolute or relative; existing\n * params are preserved. */\nexport function withAuthIntent(url: string, intent: 'recovery'): string {\n const base = typeof window === 'undefined' ? 'http://localhost' : window.location.origin\n const parsed = new URL(url, base)\n parsed.searchParams.set(AUTH_INTENT_PARAM, intent)\n return /^https?:\\/\\//i.test(url) ? parsed.toString() : `${parsed.pathname}${parsed.search}${parsed.hash}`\n}\n\n// ---------------------------------------------------------------------------\n// Whether the user owes us a password before they reach the app. Pure, so the\n// decision is testable without a browser; the React wrapper lives in\n// @fayz-ai/plugin-auth (usePasswordSetupGate).\n// ---------------------------------------------------------------------------\n\nexport type PasswordSetupReason = 'recovery' | 'invite'\n\nexport interface PasswordSetupInput {\n intent: AuthUrlIntent | null\n /** Session still resolving — the link's tokens are exchanged asynchronously. */\n isLoading: boolean\n isAuthenticated: boolean\n /** AuthUser.mustSetPassword — an invitee who never chose one. */\n mustSetPassword?: boolean\n}\n\nexport interface PasswordSetupDecision {\n reason: PasswordSetupReason | null\n expired: boolean\n checking: boolean\n}\n\nconst NOTHING: PasswordSetupDecision = { reason: null, expired: false, checking: false }\n\nexport function decidePasswordSetup(input: PasswordSetupInput): PasswordSetupDecision {\n const { intent, isLoading, isAuthenticated, mustSetPassword } = input\n\n if (intent?.kind === 'expired') return { reason: 'recovery', expired: true, checking: false }\n\n if (intent?.kind === 'recovery') {\n if (isLoading) return { reason: 'recovery', expired: false, checking: true }\n // A recovery link with no session behind it was already used or has expired.\n return { reason: 'recovery', expired: !isAuthenticated, checking: false }\n }\n\n if (!isLoading && isAuthenticated && mustSetPassword) {\n return { reason: 'invite', expired: false, checking: false }\n }\n\n return NOTHING\n}\n","import { createClient, type SupabaseClient } from '@supabase/supabase-js'\nimport type { AuthAdapter, AuthUser, AuthSession, AuthProvider } from '@fayz-ai/core'\nimport { isImpersonating } from '@fayz-ai/core'\nimport { withAuthIntent } from '../lib/url-intent'\n\n/** Metadata flag stamped on invited users (created by a magic link, so they have\n * no password yet) and cleared the moment they choose one. Metadata, not a URL\n * param: it survives the link being opened later, in another browser, or twice —\n * and it needs no new entry in Supabase's redirect allow-list. */\nexport const MUST_SET_PASSWORD_FLAG = 'fayz_must_set_password'\n\nexport interface SupabaseAuthConfig {\n supabaseUrl: string\n supabaseAnonKey: string\n supabaseClient?: SupabaseClient\n callbackUrl?: string\n resetPasswordUrl?: string\n}\n\nfunction mapSupabaseUser(supabaseUser: {\n id: string\n email?: string | null\n created_at?: string\n updated_at?: string | null\n email_confirmed_at?: string | null\n user_metadata?: Record<string, unknown>\n app_metadata?: { providers?: string[]; provider?: string }\n}): AuthUser {\n return {\n id: supabaseUser.id,\n email: supabaseUser.email ?? '',\n fullName:\n (supabaseUser.user_metadata?.['full_name'] as string | undefined) ??\n (supabaseUser.user_metadata?.['name'] as string | undefined) ??\n '',\n avatarUrl: supabaseUser.user_metadata?.['avatar_url'] as string | undefined,\n // An admin viewing as this person must not be pushed into choosing THEIR password.\n mustSetPassword: supabaseUser.user_metadata?.[MUST_SET_PASSWORD_FLAG] === true && !isImpersonating(),\n }\n}\n\nfunction mapSupabaseSession(session: {\n access_token: string\n refresh_token?: string\n expires_at?: number\n expires_in?: number\n user: Parameters<typeof mapSupabaseUser>[0]\n}): AuthSession {\n return {\n accessToken: session.access_token,\n refreshToken: session.refresh_token,\n expiresAt:\n session.expires_at ??\n Math.floor(Date.now() / 1000) + (session.expires_in ?? 3600),\n user: mapSupabaseUser(session.user),\n }\n}\n\nexport function createSupabaseAuthAdapter(config: SupabaseAuthConfig): AuthAdapter {\n const supabase = config.supabaseClient ?? createClient(config.supabaseUrl, config.supabaseAnonKey)\n\n return {\n async getSession() {\n const {\n data: { session },\n } = await supabase.auth.getSession()\n if (!session) return null\n const mapped = mapSupabaseSession(session)\n return { user: mapped.user, session: mapped }\n },\n\n onAuthStateChange(cb) {\n const {\n data: { subscription },\n } = supabase.auth.onAuthStateChange((_event, session) => {\n cb(session ? mapSupabaseUser(session.user) : null)\n })\n return () => subscription.unsubscribe()\n },\n\n async signIn(email, password) {\n const { data, error } = await supabase.auth.signInWithPassword({ email, password })\n if (error) throw error\n return mapSupabaseSession(data.session)\n },\n\n /**\n * Adopt a session handed over by a sibling application (see url-intent).\n *\n * `setSession` is the verification, not a formality: GoTrue validates the\n * tokens and rotates the refresh token, so a forged or replayed fragment\n * fails here rather than being trusted because it looked well-formed.\n */\n async adoptSession(accessToken: string, refreshToken: string) {\n const { data, error } = await supabase.auth.setSession({\n access_token: accessToken,\n refresh_token: refreshToken,\n })\n if (error || !data.session) return null\n return mapSupabaseSession(data.session)\n },\n\n async signUp(email, password, fullName) {\n const { data, error } = await supabase.auth.signUp({\n email,\n password,\n options: { data: { full_name: fullName } },\n })\n if (error) throw error\n\n // When email confirmation is required, session is null\n if (!data.session) {\n if (!data.user) throw new Error('Signup failed: no user returned')\n return {\n accessToken: '',\n refreshToken: '',\n expiresAt: 0,\n user: mapSupabaseUser(data.user),\n }\n }\n\n return mapSupabaseSession(data.session)\n },\n\n async resendConfirmation(email: string, options?: { redirectTo?: string }) {\n const { error } = await supabase.auth.resend({\n type: 'signup',\n email,\n options: {\n emailRedirectTo:\n options?.redirectTo ??\n config.callbackUrl ??\n (typeof window !== 'undefined' ? window.location.origin : undefined),\n },\n })\n if (error) throw error\n },\n\n async signOut() {\n const { error } = await supabase.auth.signOut()\n if (error) throw error\n },\n\n async signInWithOAuth(provider: AuthProvider) {\n const { error } = await supabase.auth.signInWithOAuth({\n provider: provider as 'google' | 'github' | 'apple',\n options: {\n redirectTo:\n config.callbackUrl ??\n (typeof window !== 'undefined' ? `${window.location.origin}/auth/callback` : undefined),\n },\n })\n if (error) throw error\n },\n\n async resetPassword(email, options) {\n // Root, not `/auth/reset-password`: the shell recognises a recovery link by\n // the link's own `type=recovery` param, so the flow needs no route of its\n // own — and the app root is the one URL every deployment already serves and\n // every Supabase project already allow-lists (a URL outside the allow-list\n // is silently swapped for the project's Site URL, i.e. another app).\n // A host that DOES point recovery somewhere else gets the explicit intent\n // marker, since we cannot assume its landing page carries the params.\n const explicit = options?.redirectTo ?? config.resetPasswordUrl\n const { error } = await supabase.auth.resetPasswordForEmail(email, {\n redirectTo: explicit\n ? withAuthIntent(explicit, 'recovery')\n : typeof window !== 'undefined'\n ? `${window.location.origin}/`\n : undefined,\n })\n if (error) throw error\n },\n\n async updatePassword(password) {\n // Clearing the flag in the same call as the password: one round-trip, and\n // no window where the password is set but the screen still demands one.\n const { data, error } = await supabase.auth.updateUser({\n password,\n data: { [MUST_SET_PASSWORD_FLAG]: false },\n })\n if (error) throw error\n const {\n data: { session },\n } = await supabase.auth.getSession()\n if (session) return mapSupabaseSession(session)\n if (!data.user) return undefined\n return {\n accessToken: '',\n refreshToken: '',\n expiresAt: 0,\n user: mapSupabaseUser(data.user),\n }\n },\n\n async handleCallback(url) {\n const target = url ?? (typeof window !== 'undefined' ? window.location.href : '')\n const parsed = new URL(target)\n // The fragment carries the params on the implicit flow; the query on PKCE\n // and on `{{ .TokenHash }}`-style e-mail templates.\n const fragment = new URLSearchParams(parsed.hash.replace(/^#/, ''))\n const param = (key: string) => parsed.searchParams.get(key) ?? fragment.get(key)\n\n const code = param('code')\n if (code) {\n const { data, error } = await supabase.auth.exchangeCodeForSession(code)\n if (error) throw error\n return data.session ? mapSupabaseSession(data.session) : null\n }\n\n // Templates that link straight at the app with a token instead of routing\n // through GoTrue's /verify never produce a session on their own.\n const tokenHash = param('token_hash') ?? param('token')\n const type = param('type')\n if (tokenHash && type) {\n const { data, error } = await supabase.auth.verifyOtp({\n token_hash: tokenHash,\n type: type as 'recovery' | 'invite' | 'magiclink' | 'signup' | 'email',\n })\n if (error) throw error\n return data.session ? mapSupabaseSession(data.session) : null\n }\n\n const {\n data: { session },\n } = await supabase.auth.getSession()\n return session ? mapSupabaseSession(session) : null\n },\n\n async inviteUser(email, options) {\n // Native, edge-function-free invite: a passwordless magic link. Sends the\n // e-mail + creates the auth user (anon-callable, no service-role/admin).\n // Membership is NOT granted from `data` (a client could forge it) — the\n // accept-time trigger trusts the RLS-protected public.invitations row.\n const { error } = await supabase.auth.signInWithOtp({\n email,\n options: {\n shouldCreateUser: true,\n emailRedirectTo:\n options?.redirectTo ??\n (typeof window !== 'undefined' ? `${window.location.origin}/` : undefined),\n // `data` only lands on users the OTP actually creates, which is exactly\n // who needs a password: the shell holds them on the set-password screen\n // until they choose one, so they can sign in normally from then on.\n data: { ...options?.data, [MUST_SET_PASSWORD_FLAG]: true },\n },\n })\n if (error) throw error\n },\n }\n}\n","import type { AuthAdapter, AuthUser, AuthSession } from '@fayz-ai/core'\n\nexport interface MockUser {\n id: string\n email: string\n fullName: string\n role?: string\n}\n\nconst DEFAULT_MOCK_USER: MockUser = {\n id: 'mock-user-id',\n email: 'demo@fayz.dev',\n fullName: 'Demo User',\n role: 'admin',\n}\n\nconst STORAGE_KEY = 'fayz:mock-auth'\n\nfunction toAuthUser(mockUser: MockUser): AuthUser {\n return {\n id: mockUser.id,\n email: mockUser.email,\n fullName: mockUser.fullName,\n }\n}\n\nfunction createMockSession(user: AuthUser): AuthSession {\n return {\n accessToken: `mock-token-${user.id}`,\n refreshToken: `mock-refresh-${user.id}`,\n expiresAt: Math.floor(Date.now() / 1000) + 3600,\n user,\n }\n}\n\nfunction getStored(): { user: AuthUser; session: AuthSession } | null {\n try {\n if (typeof localStorage === 'undefined') return null\n const raw = localStorage.getItem(STORAGE_KEY)\n if (!raw) return null\n return JSON.parse(raw) as { user: AuthUser; session: AuthSession }\n } catch {\n return null\n }\n}\n\nfunction setStored(data: { user: AuthUser; session: AuthSession } | null): void {\n try {\n if (typeof localStorage === 'undefined') return\n if (data) {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(data))\n } else {\n localStorage.removeItem(STORAGE_KEY)\n }\n } catch {\n // SSR or storage unavailable — silently skip\n }\n}\n\nexport function createMockAuthAdapter(mockUser: MockUser = DEFAULT_MOCK_USER): AuthAdapter {\n const listeners = new Set<(user: AuthUser | null) => void>()\n\n function notifyListeners(user: AuthUser | null): void {\n for (const cb of listeners) cb(user)\n }\n\n return {\n async getSession() {\n return getStored()\n },\n\n onAuthStateChange(cb) {\n listeners.add(cb)\n return () => {\n listeners.delete(cb)\n }\n },\n\n async signIn(email, _password) {\n // Mock accepts any credentials, but the identity FOLLOWS the email —\n // storefront customers and saas users keep their own purchase/session\n // history instead of all becoming the configured demo user.\n const stored = getStored()\n const user: AuthUser =\n stored && stored.user.email === email\n ? stored.user\n : {\n id: email === mockUser.email ? mockUser.id : `mock-${email}`,\n email,\n fullName: email === mockUser.email ? mockUser.fullName : (email.split('@')[0] ?? 'Cliente'),\n }\n const session = createMockSession(user)\n setStored({ user, session })\n notifyListeners(user)\n return session\n },\n\n async signUp(email, _password, fullName) {\n // Mock signup creates a user from the provided details\n const user: AuthUser = {\n id: `mock-${email}`,\n email,\n fullName: fullName || (email.split('@')[0] ?? 'Cliente'),\n }\n const session = createMockSession(user)\n setStored({ user, session })\n notifyListeners(user)\n return session\n },\n\n async signOut() {\n setStored(null)\n notifyListeners(null)\n },\n\n async signInWithOAuth(_provider) {\n // Mock OAuth signs in as the configured user\n const user = toAuthUser(mockUser)\n const session = createMockSession(user)\n setStored({ user, session })\n notifyListeners(user)\n },\n\n async resetPassword(_email) {\n // No-op in mock\n },\n\n async updatePassword(_password) {\n const stored = getStored()\n return stored?.session\n },\n\n async handleCallback() {\n return getStored()?.session ?? null\n },\n\n async inviteUser(_email, _options) {\n // No admin path in mock — the org mock adapter still records the pending\n // invite so the Team UI shows it. Delivery is a no-op locally.\n },\n }\n}\n","import { create } from 'zustand'\nimport type { AuthUser, AuthSession } from '@fayz-ai/core'\n\nexport interface AuthState {\n user: AuthUser | null\n session: AuthSession | null\n isLoading: boolean\n isAuthenticated: boolean\n error: Error | null\n /**\n * Set when a sign-up succeeded but the account cannot be used until the\n * address is confirmed. Deliberately NOT a session: an account in this state\n * has no access token, and treating it as signed in is what used to let\n * someone into the app where every request came back 401.\n */\n pendingVerification: { email: string } | null\n}\n\nexport interface AuthStore extends AuthState {\n setUser: (user: AuthUser | null) => void\n setSession: (session: AuthSession | null) => void\n setLoading: (isLoading: boolean) => void\n setError: (error: Error | null) => void\n setPendingVerification: (pending: { email: string } | null) => void\n reset: () => void\n}\n\nconst initialState: AuthState = {\n user: null,\n session: null,\n isLoading: true,\n isAuthenticated: false,\n error: null,\n pendingVerification: null,\n}\n\nexport const useAuthStore = create<AuthStore>((set) => ({\n ...initialState,\n\n setUser: (user) =>\n set({ user, isAuthenticated: user !== null }),\n\n setSession: (session) =>\n set({\n session,\n user: session?.user ?? null,\n isAuthenticated: session !== null,\n // A real session arriving is the confirmation landing — the notice it\n // would otherwise keep showing is now about an address already verified.\n ...(session ? { pendingVerification: null } : {}),\n }),\n\n setLoading: (isLoading) => set({ isLoading }),\n\n setError: (error) => set({ error }),\n\n setPendingVerification: (pendingVerification) => set({ pendingVerification }),\n\n reset: () => set(initialState),\n}))\n","import React, { createContext, useContext, useEffect, useRef } from 'react'\nimport type { AuthAdapter, AuthProvider as OAuthProvider, AuthSession } from '@fayz-ai/core'\nimport { useAuthStore } from './store'\nimport { readAppHandoff, clearAuthUrlTokens } from './lib/url-intent'\n\n/** Adapters that can adopt a session a sibling app handed over. Optional by\n * design: the mock adapter and any third-party one simply do not have it. */\ninterface HandoffCapableAdapter {\n adoptSession(accessToken: string, refreshToken: string): Promise<AuthSession | null>\n}\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\ninterface AuthContextValue {\n signIn: (email: string, password: string) => Promise<AuthSession>\n signUp: (email: string, password: string, fullName: string) => Promise<AuthSession>\n signOut: () => Promise<void>\n signInWithOAuth: (provider: OAuthProvider) => Promise<void>\n resetPassword: (email: string, options?: { redirectTo?: string }) => Promise<void>\n updatePassword: (password: string) => Promise<AuthSession | void>\n handleCallback: (url?: string) => Promise<AuthSession | null>\n inviteUser: (email: string, options?: { redirectTo?: string; data?: Record<string, unknown> }) => Promise<void>\n /** Re-send the sign-up confirmation. Resolves `false` when the adapter has no such path. */\n resendConfirmation: (email: string, options?: { redirectTo?: string }) => Promise<boolean>\n /** Abandon the pending sign-up so the login screen goes back to its form. */\n clearPendingVerification: () => void\n}\n\nconst AuthContext = createContext<AuthContextValue | null>(null)\n\n// ---------------------------------------------------------------------------\n// Provider\n// ---------------------------------------------------------------------------\n\nexport interface AuthProviderProps {\n adapter: AuthAdapter\n children: React.ReactNode\n}\n\nexport function AuthProvider({ adapter, children }: AuthProviderProps) {\n const { setSession, setLoading, setError, setPendingVerification, reset } = useAuthStore()\n\n // Keep a stable ref to the adapter so the effect only runs once on mount\n const adapterRef = useRef(adapter)\n adapterRef.current = adapter\n\n useEffect(() => {\n let unsubscribe: (() => void) | undefined\n\n async function init() {\n try {\n setLoading(true)\n\n // Arriving from a sibling app's switcher: adopt the session it handed\n // over BEFORE asking for our own, because this origin has none. Adapters\n // without the capability (mock, tests) simply fall through, and a\n // handoff GoTrue rejects also falls through — to the login screen, which\n // is the correct answer for tokens that do not verify.\n const handoff = readAppHandoff()\n const adopt = (adapterRef.current as Partial<HandoffCapableAdapter>).adoptSession\n let adopted: AuthSession | null = null\n if (handoff && typeof adopt === 'function') {\n adopted = await adopt.call(adapterRef.current, handoff.accessToken, handoff.refreshToken)\n clearAuthUrlTokens()\n }\n\n // Falling through on a failed adoption is deliberate: getSession() then\n // finds nothing and the user meets the login screen, which is the right\n // answer for tokens that did not verify.\n const result = adopted ? { session: adopted } : await adapterRef.current.getSession()\n setSession(result?.session ?? null)\n } catch (err) {\n setError(err instanceof Error ? err : new Error(String(err)))\n } finally {\n setLoading(false)\n }\n\n // Subscribe to future auth state changes\n unsubscribe = adapterRef.current.onAuthStateChange((user) => {\n if (!user) {\n reset()\n // Keep isLoading false after an explicit sign-out\n setLoading(false)\n return\n }\n // Positive change (adapter-driven sign-in — e.g. an external callback,\n // another tab, or a direct adapter.signUp bridge) — sync the session so\n // consumers reflect it even when the call didn't go through ctx.signIn.\n void adapterRef.current.getSession().then((result) => setSession(result?.session ?? null)).catch(() => {})\n })\n }\n\n void init()\n\n return () => {\n unsubscribe?.()\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const value: AuthContextValue = {\n async signIn(email, password) {\n setError(null)\n try {\n const session = await adapterRef.current.signIn(email, password)\n setSession(session)\n return session\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n setError(error)\n throw error\n }\n },\n\n async signUp(email, password, fullName) {\n setError(null)\n try {\n const session = await adapterRef.current.signUp(email, password, fullName)\n // A project with \"confirm email\" on returns a session with no access\n // token — the account exists but cannot do anything yet. Storing it as\n // a session marked the user authenticated, the AuthGate waved them into\n // the app, and every request 401'd. Park it as pending instead.\n if (!session.accessToken) {\n setPendingVerification({ email })\n return session\n }\n setSession(session)\n return session\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n setError(error)\n throw error\n }\n },\n\n async signOut() {\n setError(null)\n try {\n await adapterRef.current.signOut()\n reset()\n setLoading(false)\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n setError(error)\n throw error\n }\n },\n\n async signInWithOAuth(provider) {\n setError(null)\n try {\n await adapterRef.current.signInWithOAuth(provider)\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n setError(error)\n throw error\n }\n },\n\n async resetPassword(email, options) {\n setError(null)\n try {\n await adapterRef.current.resetPassword(email, options)\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n setError(error)\n throw error\n }\n },\n\n async updatePassword(password) {\n setError(null)\n try {\n const session = await adapterRef.current.updatePassword?.(password)\n if (session) setSession(session)\n return session\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n setError(error)\n throw error\n }\n },\n\n async handleCallback(url) {\n setError(null)\n try {\n const session = await adapterRef.current.handleCallback?.(url) ?? null\n if (session) setSession(session)\n return session\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n setError(error)\n throw error\n }\n },\n\n async inviteUser(email, options) {\n setError(null)\n try {\n await adapterRef.current.inviteUser?.(email, options)\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n setError(error)\n throw error\n }\n },\n\n async resendConfirmation(email, options) {\n setError(null)\n if (!adapterRef.current.resendConfirmation) return false\n try {\n await adapterRef.current.resendConfirmation(email, options)\n return true\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n setError(error)\n throw error\n }\n },\n\n clearPendingVerification() {\n setPendingVerification(null)\n setError(null)\n },\n }\n\n return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>\n}\n\n// ---------------------------------------------------------------------------\n// Hook\n// ---------------------------------------------------------------------------\n\nexport function useAuth() {\n const ctx = useContext(AuthContext)\n if (!ctx) {\n throw new Error('useAuth must be used inside <AuthProvider>')\n }\n\n const { user, session, isLoading, isAuthenticated, error, pendingVerification } = useAuthStore()\n\n return {\n user,\n session,\n isLoading,\n isAuthenticated,\n error,\n pendingVerification,\n signIn: ctx.signIn,\n signUp: ctx.signUp,\n signOut: ctx.signOut,\n signInWithOAuth: ctx.signInWithOAuth,\n resetPassword: ctx.resetPassword,\n updatePassword: ctx.updatePassword,\n handleCallback: ctx.handleCallback,\n inviteUser: ctx.inviteUser,\n resendConfirmation: ctx.resendConfirmation,\n clearPendingVerification: ctx.clearPendingVerification,\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AuthAdapter } from '@fayz-ai/core';
|
|
2
|
+
import { type AuthPluginOptions, type ResolvedAuthPlugin } from '../domain/auth-config';
|
|
3
|
+
export declare function resolveAuthAdapter(options?: AuthPluginOptions): AuthAdapter;
|
|
4
|
+
export declare function createAuthRuntime(options?: AuthPluginOptions): ResolvedAuthPlugin;
|
|
5
|
+
export declare function createAuthPlugin(options?: AuthPluginOptions): ResolvedAuthPlugin;
|
|
6
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/lib/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAGhD,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAA;AAQ9B,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,iBAAsB,GAAG,WAAW,CAoB/E;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,iBAAsB,GAAG,kBAAkB,CAcrF;AAED,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,iBAAsB,GAAG,kBAAkB,CAEpF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { chooseAuthProvider, resolveAuthRoutes, resolveOAuth } from '../chunk-4HVM2UJS.js';
|
|
2
|
+
import { createMockAuthAdapter } from '../chunk-CV4LQYNX.js';
|
|
3
|
+
import { createSupabaseAuthAdapter } from '../chunk-BGCCXJJA.js';
|
|
4
|
+
import '../chunk-2MO4QTQA.js';
|
|
5
|
+
|
|
6
|
+
// src/lib/runtime.ts
|
|
7
|
+
function absoluteUrl(path) {
|
|
8
|
+
if (typeof window === "undefined") return void 0;
|
|
9
|
+
if (/^https?:\/\//.test(path)) return path;
|
|
10
|
+
return `${window.location.origin}${path.startsWith("/") ? path : `/${path}`}`;
|
|
11
|
+
}
|
|
12
|
+
function resolveAuthAdapter(options = {}) {
|
|
13
|
+
const provider = chooseAuthProvider(options);
|
|
14
|
+
if (typeof provider === "object") return provider;
|
|
15
|
+
if (provider !== "supabase") return createMockAuthAdapter();
|
|
16
|
+
const url = options.supabase?.url;
|
|
17
|
+
const anonKey = options.supabase?.anonKey;
|
|
18
|
+
if (!url || !anonKey) {
|
|
19
|
+
throw new Error('plugin-auth provider="supabase" requires supabase.url and supabase.anonKey.');
|
|
20
|
+
}
|
|
21
|
+
return createSupabaseAuthAdapter({
|
|
22
|
+
supabaseUrl: url,
|
|
23
|
+
supabaseAnonKey: anonKey,
|
|
24
|
+
supabaseClient: options.supabase?.client,
|
|
25
|
+
callbackUrl: options.supabase?.callbackUrl ?? absoluteUrl(options.routes?.callback ?? "/auth/callback"),
|
|
26
|
+
// Left undefined, the adapter points recovery at the app root, which needs no extra redirect allow-list entry.
|
|
27
|
+
resetPasswordUrl: options.supabase?.resetPasswordUrl ?? (options.routes?.resetPassword ? absoluteUrl(options.routes.resetPassword) : void 0)
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function createAuthRuntime(options = {}) {
|
|
31
|
+
return {
|
|
32
|
+
kind: "auth",
|
|
33
|
+
adapter: resolveAuthAdapter(options),
|
|
34
|
+
requireAuth: options.requireAuth ?? true,
|
|
35
|
+
layout: options.layout ?? "split",
|
|
36
|
+
logo: options.logo,
|
|
37
|
+
tagline: options.tagline,
|
|
38
|
+
description: options.description,
|
|
39
|
+
loginAmbassadors: options.loginAmbassadors,
|
|
40
|
+
loginAmbassadorsLabel: options.loginAmbassadorsLabel,
|
|
41
|
+
oauth: resolveOAuth(options.oauth),
|
|
42
|
+
routes: resolveAuthRoutes(options.routes)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function createAuthPlugin(options = {}) {
|
|
46
|
+
return createAuthRuntime(options);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { createAuthPlugin, createAuthRuntime, resolveAuthAdapter };
|
|
50
|
+
//# sourceMappingURL=runtime.js.map
|
|
51
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/runtime.ts"],"names":[],"mappings":";;;;;;AAWA,SAAS,YAAY,IAAA,EAAkC;AACrD,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,EAAa,OAAO,MAAA;AAC1C,EAAA,IAAI,cAAA,CAAe,IAAA,CAAK,IAAI,CAAA,EAAG,OAAO,IAAA;AACtC,EAAA,OAAO,CAAA,EAAG,MAAA,CAAO,QAAA,CAAS,MAAM,CAAA,EAAG,IAAA,CAAK,UAAA,CAAW,GAAG,CAAA,GAAI,IAAA,GAAO,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,CAAA,CAAA;AAC7E;AAEO,SAAS,kBAAA,CAAmB,OAAA,GAA6B,EAAC,EAAgB;AAC/E,EAAA,MAAM,QAAA,GAAW,mBAAmB,OAAO,CAAA;AAC3C,EAAA,IAAI,OAAO,QAAA,KAAa,QAAA,EAAU,OAAO,QAAA;AACzC,EAAA,IAAI,QAAA,KAAa,UAAA,EAAY,OAAO,qBAAA,EAAsB;AAE1D,EAAA,MAAM,GAAA,GAAM,QAAQ,QAAA,EAAU,GAAA;AAC9B,EAAA,MAAM,O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AA,OAAO,kBAAkB,OAAO,CAAA;AAClC","file":"runtime.js","sourcesContent":["import type { AuthAdapter } from '@fayz-ai/core'\nimport { createMockAuthAdapter } from '../data/mock'\nimport { createSupabaseAuthAdapter } from '../data/supabase'\nimport {\n chooseAuthProvider,\n resolveAuthRoutes,\n resolveOAuth,\n type AuthPluginOptions,\n type ResolvedAuthPlugin,\n} from '../domain/auth-config'\n\nfunction absoluteUrl(path: string): string | undefined {\n if (typeof window === 'undefined') return undefined\n if (/^https?:\\/\\//.test(path)) return path\n return `${window.location.origin}${path.startsWith('/') ? path : `/${path}`}`\n}\n\nexport function resolveAuthAdapter(options: AuthPluginOptions = {}): AuthAdapter {\n const provider = chooseAuthProvider(options)\n if (typeof provider === 'object') return provider\n if (provider !== 'supabase') return createMockAuthAdapter()\n\n const url = options.supabase?.url\n const anonKey = options.supabase?.anonKey\n if (!url || !anonKey) {\n throw new Error('plugin-auth provider=\"supabase\" requires supabase.url and supabase.anonKey.')\n }\n return createSupabaseAuthAdapter({\n supabaseUrl: url,\n supabaseAnonKey: anonKey,\n supabaseClient: options.supabase?.client,\n callbackUrl: options.supabase?.callbackUrl ?? absoluteUrl(options.routes?.callback ?? '/auth/callback'),\n // Left undefined, the adapter points recovery at the app root, which needs no extra redirect allow-list entry.\n resetPasswordUrl:\n options.supabase?.resetPasswordUrl ??\n (options.routes?.resetPassword ? absoluteUrl(options.routes.resetPassword) : undefined),\n })\n}\n\nexport function createAuthRuntime(options: AuthPluginOptions = {}): ResolvedAuthPlugin {\n return {\n kind: 'auth',\n adapter: resolveAuthAdapter(options),\n requireAuth: options.requireAuth ?? true,\n layout: options.layout ?? 'split',\n logo: options.logo,\n tagline: options.tagline,\n description: options.description,\n loginAmbassadors: options.loginAmbassadors,\n loginAmbassadorsLabel: options.loginAmbassadorsLabel,\n oauth: resolveOAuth(options.oauth),\n routes: resolveAuthRoutes(options.routes),\n }\n}\n\nexport function createAuthPlugin(options: AuthPluginOptions = {}): ResolvedAuthPlugin {\n return createAuthRuntime(options)\n}\n"]}
|
package/dist/lib/url-intent.d.ts
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
/** A password-recovery link — the user must choose a new password now. */
|
|
3
|
-
{
|
|
4
|
-
kind: 'recovery';
|
|
5
|
-
}
|
|
6
|
-
/** A one-time link that was already used or has expired. */
|
|
7
|
-
| {
|
|
8
|
-
kind: 'expired';
|
|
9
|
-
message?: string;
|
|
10
|
-
};
|
|
1
|
+
import type { AuthUrlIntent } from '../domain/auth-link';
|
|
11
2
|
/** Query param apps can put on their own redirect URLs to force the
|
|
12
3
|
* set-password screen (e.g. when they override `resetPasswordUrl`). */
|
|
13
4
|
export declare const AUTH_INTENT_PARAM = "fayz_auth";
|
|
@@ -56,20 +47,5 @@ export declare function clearAuthUrlTokens(): void;
|
|
|
56
47
|
/** Add the intent marker to a redirect URL. Absolute or relative; existing
|
|
57
48
|
* params are preserved. */
|
|
58
49
|
export declare function withAuthIntent(url: string, intent: 'recovery'): string;
|
|
59
|
-
export type PasswordSetupReason = 'recovery' | 'invite';
|
|
60
|
-
export interface PasswordSetupInput {
|
|
61
|
-
intent: AuthUrlIntent | null;
|
|
62
|
-
/** Session still resolving — the link's tokens are exchanged asynchronously. */
|
|
63
|
-
isLoading: boolean;
|
|
64
|
-
isAuthenticated: boolean;
|
|
65
|
-
/** AuthUser.mustSetPassword — an invitee who never chose one. */
|
|
66
|
-
mustSetPassword?: boolean;
|
|
67
|
-
}
|
|
68
|
-
export interface PasswordSetupDecision {
|
|
69
|
-
reason: PasswordSetupReason | null;
|
|
70
|
-
expired: boolean;
|
|
71
|
-
checking: boolean;
|
|
72
|
-
}
|
|
73
|
-
export declare function decidePasswordSetup(input: PasswordSetupInput): PasswordSetupDecision;
|
|
74
50
|
export {};
|
|
75
51
|
//# sourceMappingURL=url-intent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-intent.d.ts","sourceRoot":"","sources":["../../src/lib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,3 @@
|
|
|
1
|
+
export { APP_HANDOFF_PARAM, APP_HANDOFF_REFRESH_PARAM, APP_HANDOFF_TENANT_PARAM, AUTH_INTENT_PARAM, buildAppHandoffUrl, clearAuthUrlTokens, readAppHandoff, readAuthUrlIntent, withAuthIntent } from '../chunk-2MO4QTQA.js';
|
|
2
|
+
//# sourceMappingURL=url-intent.js.map
|
|
3
|
+
//# sourceMappingURL=url-intent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"url-intent.js"}
|
package/dist/store.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"store.js"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface AuthCallbackPageProps {
|
|
3
|
+
onSuccess?: () => void;
|
|
4
|
+
onError?: (error: Error) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function AuthCallbackPage({ onSuccess, onError }: AuthCallbackPageProps): React.JSX.Element;
|
|
7
|
+
//# sourceMappingURL=AuthCallbackPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthCallbackPage.d.ts","sourceRoot":"","sources":["../../src/views/AuthCallbackPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;CACjC;AAED,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,qBAAqB,qBA8B7E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useAuth } from '../chunk-Q6DFI35B.js';
|
|
2
|
+
import '../chunk-OI74ER2Z.js';
|
|
3
|
+
import '../chunk-2MO4QTQA.js';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function AuthCallbackPage({ onSuccess, onError }) {
|
|
8
|
+
const { handleCallback } = useAuth();
|
|
9
|
+
const [error, setError] = React.useState(null);
|
|
10
|
+
React.useEffect(() => {
|
|
11
|
+
let cancelled = false;
|
|
12
|
+
handleCallback(typeof window === "undefined" ? void 0 : window.location.href).then(() => {
|
|
13
|
+
if (!cancelled) onSuccess?.();
|
|
14
|
+
}).catch((err) => {
|
|
15
|
+
const errorObject = err instanceof Error ? err : new Error(String(err));
|
|
16
|
+
if (!cancelled) {
|
|
17
|
+
setError(errorObject.message);
|
|
18
|
+
onError?.(errorObject);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return () => {
|
|
22
|
+
cancelled = true;
|
|
23
|
+
};
|
|
24
|
+
}, [handleCallback, onError, onSuccess]);
|
|
25
|
+
return /* @__PURE__ */ jsx("div", { className: "flex min-h-screen items-center justify-center bg-background p-6 text-center", children: /* @__PURE__ */ jsxs("div", { children: [
|
|
26
|
+
/* @__PURE__ */ jsx("h1", { className: "text-xl font-semibold text-foreground", children: error ? "Authentication failed" : "Completing sign in..." }),
|
|
27
|
+
error && /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-destructive", children: error })
|
|
28
|
+
] }) });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { AuthCallbackPage };
|
|
32
|
+
//# sourceMappingURL=AuthCallbackPage.js.map
|
|
33
|
+
//# sourceMappingURL=AuthCallbackPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/views/AuthCallbackPage.tsx"],"names":[],"mappings":";;;;;;AAQO,SAAS,gBAAA,CAAiB,EAAE,SAAA,EAAW,OAAA,EAAQ,EAA0B;AAC9E,EAAA,MAAM,EAAE,cAAA,EAAe,GAAI,OAAA,EAAQ;AACnC,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAU,eAAwB,IAAI,CAAA;AAE5D,EAAM,gBAAU,MAAM;AACpB,IAAA,IAAI,SAAA,GAAY,KAAA;AAChB,IAAA,cAAA,CAAe,OAAO,WAAW,WAAA,GAAc,MAAA,GAAY,OAAO,QAAA,CAAS,IAAI,CAAA,CAC5E,IAAA,CAAK,MAAM;AACV,MAAA,IAAI,CAAC,WAAW,SAAA,IAAY;AAAA,IAC9B,CAAC,CAAA,CACA,KAAA,CAAM,CAAC,GAAA,KAAiB;AACvB,MAAA,MAAM,WAAA,GAAc,eAAe,KAAA,GAAQ,GAAA,GAAM,IAAI,KAAA,CAAM,MAAA,CAAO,GAAG,CAAC,CAAA;AACtE,MAAA,IAAI,CAAC,SAAA,EAAW;AACd,QAAA,QAAA,CAAS,YAAY,OAAO,CAAA;AAC5B,QAAA,OAAA,GAAU,WAAW,CAAA;AAAA,MACvB;AAAA,IACF,CAAC,CAAA;AACH,IAAA,OAAO,MAAM;AACX,MAAA,SAAA,GAAY,IAAA;AAAA,IACd,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,cAAA,EAAgB,OAAA,EAAS,SAAS,CAAC,CAAA;AAEvC,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,6EAAA,EACb,+BAAC,KAAA,EAAA,EACC,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,uCAAA,EAAyC,QAAA,EAAA,KAAA,GAAQ,0BAA0B,uBAAA,EAAwB,CAAA;AAAA,IAChH,KAAA,oBAAS,GAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,iCAAiC,QAAA,EAAA,KAAA,EAAM;AAAA,GAAA,EAChE,CAAA,EACF,CAAA;AAEJ","file":"AuthCallbackPage.js","sourcesContent":["import * as React from 'react'\nimport { useAuth } from '../context'\n\nexport interface AuthCallbackPageProps {\n onSuccess?: () => void\n onError?: (error: Error) => void\n}\n\nexport function AuthCallbackPage({ onSuccess, onError }: AuthCallbackPageProps) {\n const { handleCallback } = useAuth()\n const [error, setError] = React.useState<string | null>(null)\n\n React.useEffect(() => {\n let cancelled = false\n handleCallback(typeof window === 'undefined' ? undefined : window.location.href)\n .then(() => {\n if (!cancelled) onSuccess?.()\n })\n .catch((err: unknown) => {\n const errorObject = err instanceof Error ? err : new Error(String(err))\n if (!cancelled) {\n setError(errorObject.message)\n onError?.(errorObject)\n }\n })\n return () => {\n cancelled = true\n }\n }, [handleCallback, onError, onSuccess])\n\n return (\n <div className=\"flex min-h-screen items-center justify-center bg-background p-6 text-center\">\n <div>\n <h1 className=\"text-xl font-semibold text-foreground\">{error ? 'Authentication failed' : 'Completing sign in...'}</h1>\n {error && <p className=\"mt-2 text-sm text-destructive\">{error}</p>}\n </div>\n </div>\n )\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import { type LoginPageProps } from './LoginPage';
|
|
3
|
+
export interface AuthGateProps extends LoginPageProps {
|
|
4
|
+
requireAuth?: boolean;
|
|
5
|
+
loadingFallback?: React.ReactNode;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function AuthGate({ requireAuth, loadingFallback, children, ...loginProps }: AuthGateProps): React.JSX.Element;
|
|
9
|
+
//# sourceMappingURL=AuthGate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthGate.d.ts","sourceRoot":"","sources":["../../src/views/AuthGate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AAEnC,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5D,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,wBAAgB,QAAQ,CAAC,EAAE,WAAkB,EAAE,eAAe,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,EAAE,aAAa,qBAevG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LoginPage } from '../chunk-7JYNJQJJ.js';
|
|
2
|
+
import '../chunk-W35GQEGU.js';
|
|
3
|
+
import '../chunk-HKILBDG2.js';
|
|
4
|
+
import '../chunk-WZVZMNLB.js';
|
|
5
|
+
import '../chunk-QJRTW7Q3.js';
|
|
6
|
+
import '../chunk-KLQDHFVS.js';
|
|
7
|
+
import '../chunk-4HVM2UJS.js';
|
|
8
|
+
import '../chunk-W7565FXD.js';
|
|
9
|
+
import { useAuth } from '../chunk-Q6DFI35B.js';
|
|
10
|
+
import '../chunk-OI74ER2Z.js';
|
|
11
|
+
import '../chunk-REU4D5UF.js';
|
|
12
|
+
import '../chunk-SMFXGZN7.js';
|
|
13
|
+
import '../chunk-55RFOMW5.js';
|
|
14
|
+
import '../chunk-2MO4QTQA.js';
|
|
15
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
16
|
+
|
|
17
|
+
function AuthGate({ requireAuth = true, loadingFallback, children, ...loginProps }) {
|
|
18
|
+
const { isAuthenticated, isLoading } = useAuth();
|
|
19
|
+
if (!requireAuth || isAuthenticated) return /* @__PURE__ */ jsx(Fragment, { children });
|
|
20
|
+
if (isLoading) {
|
|
21
|
+
return /* @__PURE__ */ jsx(Fragment, { children: loadingFallback ?? /* @__PURE__ */ jsx("div", { className: "flex min-h-screen items-center justify-center bg-background", children: /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: "Loading..." }) }) });
|
|
22
|
+
}
|
|
23
|
+
return /* @__PURE__ */ jsx(LoginPage, { ...loginProps });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { AuthGate };
|
|
27
|
+
//# sourceMappingURL=AuthGate.js.map
|
|
28
|
+
//# sourceMappingURL=AuthGate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/views/AuthGate.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAUO,SAAS,QAAA,CAAS,EAAE,WAAA,GAAc,IAAA,EAAM,iBAAiB,QAAA,EAAU,GAAG,YAAW,EAAkB;AACxG,EAAA,MAAM,EAAE,eAAA,EAAiB,SAAA,EAAU,GAAI,OAAA,EAAQ;AAC/C,EAAA,IAAI,CAAC,WAAA,IAAe,eAAA,EAAiB,uCAAU,QAAA,EAAS,CAAA;AACxD,EAAA,IAAI,SAAA,EAAW;AACb,IAAA,uBACE,GAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA,eAAA,oBACC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,6DAAA,EACb,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,+BAAA,EAAgC,QAAA,EAAA,YAAA,EAAU,CAAA,EAC5D,CAAA,EAEJ,CAAA;AAAA,EAEJ;AACA,EAAA,uBAAO,GAAA,CAAC,SAAA,EAAA,EAAW,GAAG,UAAA,EAAY,CAAA;AACpC","file":"AuthGate.js","sourcesContent":["import type * as React from 'react'\nimport { useAuth } from '../context'\nimport { LoginPage, type LoginPageProps } from './LoginPage'\n\nexport interface AuthGateProps extends LoginPageProps {\n requireAuth?: boolean\n loadingFallback?: React.ReactNode\n children: React.ReactNode\n}\n\nexport function AuthGate({ requireAuth = true, loadingFallback, children, ...loginProps }: AuthGateProps) {\n const { isAuthenticated, isLoading } = useAuth()\n if (!requireAuth || isAuthenticated) return <>{children}</>\n if (isLoading) {\n return (\n <>\n {loadingFallback ?? (\n <div className=\"flex min-h-screen items-center justify-center bg-background\">\n <span className=\"text-sm text-muted-foreground\">Loading...</span>\n </div>\n )}\n </>\n )\n }\n return <LoginPage {...loginProps} />\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ForgotPasswordFormProps {
|
|
3
|
+
redirectTo?: string;
|
|
4
|
+
onSent?: (email: string) => void;
|
|
5
|
+
onBackToLogin?: () => void;
|
|
6
|
+
/** Pre-filled with whatever the user already typed on the login form. */
|
|
7
|
+
initialEmail?: string;
|
|
8
|
+
onEmailChange?: (email: string) => void;
|
|
9
|
+
/** Copy overrides — the set-password screen reuses this form to hand out a
|
|
10
|
+
* fresh link, where "Send reset link" is the wrong label. */
|
|
11
|
+
emailLabel?: string;
|
|
12
|
+
submitLabel?: string;
|
|
13
|
+
sendingLabel?: string;
|
|
14
|
+
sentLabel?: string;
|
|
15
|
+
backLabel?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function ForgotPasswordForm({ redirectTo, onSent, onBackToLogin, initialEmail, onEmailChange, emailLabel, submitLabel, sendingLabel, sentLabel, backLabel, }: ForgotPasswordFormProps): React.JSX.Element;
|
|
18
|
+
//# sourceMappingURL=ForgotPasswordForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ForgotPasswordForm.d.ts","sourceRoot":"","sources":["../../src/views/ForgotPasswordForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,yEAAyE;IACzE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC;kEAC8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,kBAAkB,CAAC,EACjC,UAAU,EACV,MAAM,EACN,aAAa,EACb,YAAiB,EACjB,aAAa,EACb,UAAkC,EAClC,WAAiE,EACjE,YAA8C,EAC9C,SAA0F,EAC1F,SAAsD,GACvD,EAAE,uBAAuB,qBAiDzB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ForgotPasswordForm } from '../chunk-W7565FXD.js';
|
|
2
|
+
import '../chunk-Q6DFI35B.js';
|
|
3
|
+
import '../chunk-OI74ER2Z.js';
|
|
4
|
+
import '../chunk-55RFOMW5.js';
|
|
5
|
+
import '../chunk-2MO4QTQA.js';
|
|
6
|
+
//# sourceMappingURL=ForgotPasswordForm.js.map
|
|
7
|
+
//# sourceMappingURL=ForgotPasswordForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"ForgotPasswordForm.js"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { OAuthProviderKey } from '../domain/auth-config';
|
|
3
|
+
export interface LoginFormProps {
|
|
4
|
+
onSuccess?: () => void;
|
|
5
|
+
onForgotPassword?: () => void;
|
|
6
|
+
showOAuth?: boolean;
|
|
7
|
+
oauthProviders?: OAuthProviderKey[];
|
|
8
|
+
/** Providers rendered as "em breve" — declared but not wired yet. */
|
|
9
|
+
oauthComingSoon?: OAuthProviderKey[];
|
|
10
|
+
/** Seeds the field, so switching between login and recovery never asks for the
|
|
11
|
+
* e-mail the user already typed. */
|
|
12
|
+
initialEmail?: string;
|
|
13
|
+
onEmailChange?: (email: string) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function LoginForm({ onSuccess, onForgotPassword, showOAuth, oauthProviders, oauthComingSoon, initialEmail, onEmailChange, }: LoginFormProps): React.JSX.Element;
|
|
16
|
+
//# sourceMappingURL=LoginForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoginForm.d.ts","sourceRoot":"","sources":["../../src/views/LoginForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAI7D,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,cAAc,CAAC,EAAE,gBAAgB,EAAE,CAAA;IACnC,qEAAqE;IACrE,eAAe,CAAC,EAAE,gBAAgB,EAAE,CAAA;IACpC;yCACqC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACxC;AAED,wBAAgB,SAAS,CAAC,EACxB,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,eAAe,EACf,YAAiB,EACjB,aAAa,GACd,EAAE,cAAc,qBAqEhB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { LoginForm } from '../chunk-W35GQEGU.js';
|
|
2
|
+
import '../chunk-WZVZMNLB.js';
|
|
3
|
+
import '../chunk-Q6DFI35B.js';
|
|
4
|
+
import '../chunk-OI74ER2Z.js';
|
|
5
|
+
import '../chunk-55RFOMW5.js';
|
|
6
|
+
import '../chunk-2MO4QTQA.js';
|
|
7
|
+
//# sourceMappingURL=LoginForm.js.map
|
|
8
|
+
//# sourceMappingURL=LoginForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"LoginForm.js"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type AuthLayout, type LoginAmbassador, type OAuthProviderKey } from '../domain/auth-config';
|
|
3
|
+
export interface LoginPageProps {
|
|
4
|
+
appName?: string;
|
|
5
|
+
logo?: React.ReactNode;
|
|
6
|
+
loginLogo?: React.ReactNode;
|
|
7
|
+
layout?: AuthLayout;
|
|
8
|
+
tagline?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Product ambassadors shown as a small social-proof avatar strip above the
|
|
11
|
+
* tagline on the split-layout brand panel. Renders nothing when empty/imageless. */
|
|
12
|
+
loginAmbassadors?: LoginAmbassador[];
|
|
13
|
+
/** Optional microtext beside the ambassador strip, e.g. "+2 mil profissionais". */
|
|
14
|
+
loginAmbassadorsLabel?: string;
|
|
15
|
+
showOAuth?: boolean;
|
|
16
|
+
oauthProviders?: OAuthProviderKey[];
|
|
17
|
+
/** Providers shown as "em breve" — declared but not wired yet. */
|
|
18
|
+
oauthComingSoon?: OAuthProviderKey[];
|
|
19
|
+
resetPasswordUrl?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Length of the free trial, in days, as the sign-up screen promises it.
|
|
22
|
+
*
|
|
23
|
+
* Display only — the window itself is stamped by the database when the
|
|
24
|
+
* workspace is created. Absent means the app has no trial to offer, and the
|
|
25
|
+
* screen says nothing rather than inventing one.
|
|
26
|
+
*/
|
|
27
|
+
trialDays?: number;
|
|
28
|
+
/** Shown under the sign-up button when the app has them. */
|
|
29
|
+
termsUrl?: string;
|
|
30
|
+
privacyUrl?: string;
|
|
31
|
+
onSuccess?: () => void;
|
|
32
|
+
}
|
|
33
|
+
export declare function LoginPage({ appName, logo, loginLogo, layout, tagline, description, loginAmbassadors, loginAmbassadorsLabel, showOAuth, oauthProviders, oauthComingSoon, resetPasswordUrl, trialDays, termsUrl, privacyUrl, onSuccess, }: LoginPageProps): React.JSX.Element;
|
|
34
|
+
//# sourceMappingURL=LoginPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoginPage.d.ts","sourceRoot":"","sources":["../../src/views/LoginPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9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
|
+
import '../chunk-WZVZMNLB.js';
|
|
5
|
+
import '../chunk-QJRTW7Q3.js';
|
|
6
|
+
import '../chunk-KLQDHFVS.js';
|
|
7
|
+
import '../chunk-4HVM2UJS.js';
|
|
8
|
+
import '../chunk-W7565FXD.js';
|
|
9
|
+
import '../chunk-Q6DFI35B.js';
|
|
10
|
+
import '../chunk-OI74ER2Z.js';
|
|
11
|
+
import '../chunk-REU4D5UF.js';
|
|
12
|
+
import '../chunk-SMFXGZN7.js';
|
|
13
|
+
import '../chunk-55RFOMW5.js';
|
|
14
|
+
import '../chunk-2MO4QTQA.js';
|
|
15
|
+
//# sourceMappingURL=LoginPage.js.map
|
|
16
|
+
//# sourceMappingURL=LoginPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"LoginPage.js"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { AuthProvider } from '@fayz-ai/core';
|
|
3
|
+
import type { OAuthProviderKey } from '../domain/auth-config';
|
|
4
|
+
export interface OAuthButtonsProps {
|
|
5
|
+
providers?: OAuthProviderKey[];
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Providers that are on screen but cannot sign anybody in yet.
|
|
9
|
+
*
|
|
10
|
+
* Shown rather than hidden because the app declares them and the merchant asks
|
|
11
|
+
* for them — but a button that opens a broken consent screen is worse than one
|
|
12
|
+
* that says it is not ready. Enabling later is removing the id from this list.
|
|
13
|
+
*/
|
|
14
|
+
comingSoon?: OAuthProviderKey[];
|
|
15
|
+
onProviderClick?: (provider: AuthProvider) => void | Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export declare function OAuthButtons({ providers, disabled, comingSoon, onProviderClick }: OAuthButtonsProps): React.JSX.Element;
|
|
18
|
+
//# sourceMappingURL=OAuthButtons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuthButtons.d.ts","sourceRoot":"","sources":["../../src/views/OAuthButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAwB7D,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC/B,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACnE;AAED,wBAAgB,YAAY,CAAC,EAAE,SAAsB,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,EAAE,iBAAiB,qBA0BhH"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { OAuthButtons } from '../chunk-WZVZMNLB.js';
|
|
2
|
+
import '../chunk-Q6DFI35B.js';
|
|
3
|
+
import '../chunk-OI74ER2Z.js';
|
|
4
|
+
import '../chunk-55RFOMW5.js';
|
|
5
|
+
import '../chunk-2MO4QTQA.js';
|
|
6
|
+
//# sourceMappingURL=OAuthButtons.js.map
|
|
7
|
+
//# sourceMappingURL=OAuthButtons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"OAuthButtons.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResetPasswordForm.d.ts","sourceRoot":"","sources":["../../src/views/ResetPasswordForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,EAAE,sBAAsB,qBA6CtE"}
|