@supabase/auth-helpers-react
Advanced tools
Comparing version
# @supabase/auth-helpers-react | ||
## 0.2.0 | ||
### Minor Changes | ||
- f399820: Using shared package as a dependency | ||
Update sveltekit package with latest code to update tokens | ||
## 0.1.0 | ||
@@ -4,0 +11,0 @@ |
@@ -1,4 +0,3 @@ | ||
import { SupabaseClient, User } from '@supabase/supabase-js'; | ||
export { User } from '@supabase/supabase-js'; | ||
import { UserState, UserFetcher } from 'shared/types'; | ||
import { UserState } from '@supabase/auth-helpers-shared'; | ||
@@ -5,0 +4,0 @@ interface Props { |
@@ -46,16 +46,3 @@ var __create = Object.create; | ||
var import_react = __toESM(require("react")); | ||
// ../shared/utils/constants.ts | ||
var COOKIE_OPTIONS = { | ||
name: "sb", | ||
lifetime: 7 * 24 * 60 * 60, | ||
domain: "", | ||
path: "/", | ||
sameSite: "lax" | ||
}; | ||
var TOKEN_REFRESH_MARGIN = 10; | ||
var RETRY_INTERVAL = 2; | ||
var MAX_RETRIES = 10; | ||
// src/components/UserProvider.tsx | ||
var import_auth_helpers_shared = require("@supabase/auth-helpers-shared"); | ||
var networkRetries = 0; | ||
@@ -99,6 +86,6 @@ var refreshTokenTimer; | ||
if (error2) { | ||
if (error2 === "Request failed" && networkRetries < MAX_RETRIES) { | ||
if (error2 === "Request failed" && networkRetries < import_auth_helpers_shared.MAX_RETRIES) { | ||
if (refreshTokenTimer) | ||
clearTimeout(refreshTokenTimer); | ||
refreshTokenTimer = setTimeout(checkSession, RETRY_INTERVAL ** networkRetries * 100); | ||
refreshTokenTimer = setTimeout(checkSession, import_auth_helpers_shared.RETRY_INTERVAL ** networkRetries * 100); | ||
return; | ||
@@ -121,3 +108,3 @@ } | ||
const expiresIn = expiresAt - timeNow; | ||
const refreshDurationBeforeExpires = expiresIn > TOKEN_REFRESH_MARGIN ? TOKEN_REFRESH_MARGIN : 0.5; | ||
const refreshDurationBeforeExpires = expiresIn > import_auth_helpers_shared.TOKEN_REFRESH_MARGIN ? import_auth_helpers_shared.TOKEN_REFRESH_MARGIN : 0.5; | ||
timeout = (expiresIn - refreshDurationBeforeExpires) * 1e3; | ||
@@ -124,0 +111,0 @@ } |
{ | ||
"name": "@supabase/auth-helpers-react", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"main": "dist/index.js", | ||
@@ -28,3 +28,2 @@ "types": "dist/index.d.ts", | ||
"rimraf": "^3.0.2", | ||
"shared": "0.1.0", | ||
"tsconfig": "0.1.0", | ||
@@ -34,2 +33,5 @@ "tsup": "^5.12.5", | ||
}, | ||
"dependencies": { | ||
"@supabase/auth-helpers-shared": "0.1.0" | ||
}, | ||
"scripts": { | ||
@@ -39,4 +41,3 @@ "build": "pnpm clean && tsup", | ||
"clean:all": "rimraf dist node_modules" | ||
}, | ||
"readme": "# @supabase/auth-helpers-react\n\nThis submodules provides components and hooks that can be used across all React based frameworks (e.g. Next.js, Remix).\n" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
10
-9.09%25518
-2.3%1
Infinity%373
-3.12%+ Added
+ Added