@q3assets/auth 0.2.3 → 0.2.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/clients.ts +7 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@q3assets/auth",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "exports": {
5
5
  ".": "./src/index.ts",
6
6
  "./login": "./src/login.tsx",
package/src/clients.ts CHANGED
@@ -1,20 +1,21 @@
1
+ import { createBrowserClient as createSSRBrowserClient } from "@supabase/ssr"
1
2
  import { createClient, type SupabaseClient } from "@supabase/supabase-js"
2
3
 
3
4
  /**
4
- * Browser-side Supabase client. Uses the public anon key.
5
- * Each project provides its own URL and key.
5
+ * Browser-side Supabase client using @supabase/ssr.
6
+ * Stores auth state (including PKCE verifiers) in cookies,
7
+ * which survive SSR, page navigations, and middleware.
6
8
  */
7
9
  export function createBrowserClient(
8
10
  url: string,
9
11
  anonKey: string
10
12
  ): SupabaseClient {
11
- return createClient(url, anonKey, {
13
+ return createSSRBrowserClient(url, anonKey, {
12
14
  auth: {
13
15
  flowType: "pkce",
14
- detectSessionInUrl: true,
15
- persistSession: true,
16
+ detectSessionInUrl: false,
16
17
  },
17
- })
18
+ }) as unknown as SupabaseClient
18
19
  }
19
20
 
20
21
  /**