mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
chore: share dashboard auth state across apps
This commit is contained in:
1 parent
713ef19173
commit
dad187b782
17 files changed
+307
-10194
No files matched your search
@@ -45,9 +45,9 @@
|
||||
"@mdx-js/react": "^1.6.22",
|
||||
"@next/mdx": "^12.0.4",
|
||||
"@radix-ui/react-accordion": "^1.0.1",
|
||||
"@supabase/auth-helpers-nextjs": "^0.5.4",
|
||||
"@supabase/auth-helpers-nextjs": "^0.5.6",
|
||||
"@supabase/auth-helpers-react": "^0.3.1",
|
||||
"@supabase/supabase-js": "^2.8.0",
|
||||
"@supabase/supabase-js": "^2.13.0",
|
||||
"algoliasearch": "^4.14.2",
|
||||
"babel": "^6.23.0",
|
||||
"clsx": "^1.2.1",
|
||||
|
||||
+16
-12
@@ -1,6 +1,6 @@
|
||||
import { createBrowserSupabaseClient } from '@supabase/auth-helpers-nextjs'
|
||||
import { SessionContextProvider } from '@supabase/auth-helpers-react'
|
||||
import { ThemeProvider } from 'common/Providers'
|
||||
import { AuthProvider, ThemeProvider } from 'common'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { AppPropsWithLayout } from 'types'
|
||||
@@ -66,6 +66,20 @@ function MyApp({ Component, pageProps }: AppPropsWithLayout) {
|
||||
<Favicons />
|
||||
{IS_PLATFORM || LOCAL_SUPABASE ? (
|
||||
<SessionContextProvider supabaseClient={supabase}>
|
||||
<AuthProvider>
|
||||
<ThemeProvider>
|
||||
<SearchProvider>
|
||||
{/* <CommandMenuProvider site="docs"> */}
|
||||
<SiteLayout>
|
||||
<Component {...pageProps} />
|
||||
</SiteLayout>
|
||||
{/* </CommandMenuProvider> */}
|
||||
</SearchProvider>
|
||||
</ThemeProvider>
|
||||
</AuthProvider>
|
||||
</SessionContextProvider>
|
||||
) : (
|
||||
<AuthProvider>
|
||||
<ThemeProvider>
|
||||
<SearchProvider>
|
||||
{/* <CommandMenuProvider site="docs"> */}
|
||||
@@ -75,17 +89,7 @@ function MyApp({ Component, pageProps }: AppPropsWithLayout) {
|
||||
{/* </CommandMenuProvider> */}
|
||||
</SearchProvider>
|
||||
</ThemeProvider>
|
||||
</SessionContextProvider>
|
||||
) : (
|
||||
<ThemeProvider>
|
||||
<SearchProvider>
|
||||
{/* <CommandMenuProvider site="docs"> */}
|
||||
<SiteLayout>
|
||||
<Component {...pageProps} />
|
||||
</SiteLayout>
|
||||
{/* </CommandMenuProvider> */}
|
||||
</SearchProvider>
|
||||
</ThemeProvider>
|
||||
</AuthProvider>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@ import Solutions from '~/components/Nav/Product'
|
||||
import Developers from '~/components/Nav/Developers'
|
||||
import Announcement from '~/components/Nav/Announcement'
|
||||
|
||||
import { useTheme } from 'common/Providers'
|
||||
import { useIsLoggedIn, useTheme } from 'common'
|
||||
import TextLink from '../TextLink'
|
||||
import Image from 'next/image'
|
||||
import * as supabaseLogoWordmarkDark from 'common/assets/images/supabase-logo-wordmark--dark.png'
|
||||
@@ -24,6 +24,7 @@ const Nav = () => {
|
||||
const [open, setOpen] = useState(false)
|
||||
const [openProduct, setOpenProduct] = useState(false)
|
||||
const [openDevelopers, setOpenDevelopers] = useState(false)
|
||||
const isLoggedIn = useIsLoggedIn()
|
||||
|
||||
const isLaunchWeekPage = pathname.includes('launch-week')
|
||||
const showLaunchWeekNavMode = isLaunchWeekPage && !open && !openProduct && !openDevelopers
|
||||
@@ -51,12 +52,12 @@ const Nav = () => {
|
||||
const { name, description, icon, label, url } = solution
|
||||
|
||||
const content = (
|
||||
<div className="mb-3 flex md:h-full lg:flex-col">
|
||||
<div className="flex mb-3 md:h-full lg:flex-col">
|
||||
<div className="flex-shrink-0">
|
||||
<div className="inline-flex h-10 w-10 items-center justify-center rounded-md bg-gray-800 text-white dark:bg-white dark:text-gray-800 sm:h-12 sm:w-12">
|
||||
<div className="inline-flex items-center justify-center w-10 h-10 text-white bg-gray-800 rounded-md dark:bg-white dark:text-gray-800 sm:h-12 sm:w-12">
|
||||
{/* <!-- Heroicon name: chart-bar --> */}
|
||||
<svg
|
||||
className="h-6 w-6"
|
||||
className="w-6 h-6"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
@@ -77,10 +78,10 @@ const Nav = () => {
|
||||
</Badge>
|
||||
)}
|
||||
</p>
|
||||
<p className="text-scale-1100 dark:text-dark-100 mt-1 text-sm">{description}</p>
|
||||
<p className="mt-1 text-sm text-scale-1100 dark:text-dark-100">{description}</p>
|
||||
</div>
|
||||
{url && (
|
||||
<p className="text-brand-900 mt-2 text-sm font-medium lg:mt-4">
|
||||
<p className="mt-2 text-sm font-medium text-brand-900 lg:mt-4">
|
||||
<TextLink label={label ? 'Get notified' : 'Learn more'} url={url} />
|
||||
</p>
|
||||
)}
|
||||
@@ -89,14 +90,14 @@ const Nav = () => {
|
||||
)
|
||||
return url ? (
|
||||
<Link href={url} key={`solution_${idx}`}>
|
||||
<a className="dark:hover:bg-scale-600 -m-3 my-2 flex flex-col justify-between rounded-lg p-3 transition duration-150 ease-in-out hover:bg-gray-50">
|
||||
<a className="flex flex-col justify-between p-3 my-2 -m-3 transition duration-150 ease-in-out rounded-lg dark:hover:bg-scale-600 hover:bg-gray-50">
|
||||
{content}
|
||||
</a>
|
||||
</Link>
|
||||
) : (
|
||||
<div
|
||||
key={`solution_${idx}`}
|
||||
className="-m-3 flex flex-col justify-between rounded-lg p-3 transition duration-150 ease-in-out"
|
||||
className="flex flex-col justify-between p-3 -m-3 transition duration-150 ease-in-out rounded-lg"
|
||||
>
|
||||
{content}
|
||||
</div>
|
||||
@@ -123,7 +124,7 @@ const Nav = () => {
|
||||
<span className="sr-only">Open main menu</span>
|
||||
|
||||
<svg
|
||||
className="block h-6 w-6"
|
||||
className="block w-6 h-6"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
@@ -139,7 +140,7 @@ const Nav = () => {
|
||||
</svg>
|
||||
|
||||
<svg
|
||||
className="hidden h-6 w-6"
|
||||
className="hidden w-6 h-6"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
@@ -208,17 +209,17 @@ const Nav = () => {
|
||||
showLaunchWeekNavMode && '!opacity-100 border-[#e0d2f430]',
|
||||
].join(' ')}
|
||||
>
|
||||
{/* <div className="lg:container mx-auto relative flex justify-between h-16 lg:px-10 xl:px-0"> */}
|
||||
<div className="relative mx-auto flex h-16 justify-between lg:container lg:px-16 xl:px-20">
|
||||
{/* <div className="relative flex justify-between h-16 mx-auto lg:container lg:px-10 xl:px-0"> */}
|
||||
<div className="relative flex justify-between h-16 mx-auto lg:container lg:px-16 xl:px-20">
|
||||
<HamburgerButton
|
||||
toggleFlyOut={() => setOpen(true)}
|
||||
showLaunchWeekNavMode={showLaunchWeekNavMode}
|
||||
/>
|
||||
<div className="flex flex-1 items-center justify-center sm:items-stretch lg:justify-between">
|
||||
<div className="flex items-center justify-center flex-1 sm:items-stretch lg:justify-between">
|
||||
<div className="flex items-center">
|
||||
<div className="flex flex-shrink-0 items-center">
|
||||
<div className="flex items-center flex-shrink-0">
|
||||
<Link href="/" as="/">
|
||||
<a className="block h-6 w-auto">
|
||||
<a className="block w-auto h-6">
|
||||
<Image
|
||||
src={
|
||||
isLaunchWeekPage
|
||||
@@ -274,13 +275,13 @@ const Nav = () => {
|
||||
<div className="flex items-center gap-2">
|
||||
<Button
|
||||
as="a"
|
||||
className="group hidden lg:flex"
|
||||
className="hidden group lg:flex"
|
||||
// @ts-ignore
|
||||
href="https://github.com/supabase/supabase"
|
||||
target="_blank"
|
||||
type="text"
|
||||
icon={
|
||||
<div className="text-brand-800 flex h-4 w-4 items-center justify-center">
|
||||
<div className="flex items-center justify-center w-4 h-4 text-brand-800">
|
||||
<div
|
||||
className={[
|
||||
`text-scale-900 flex h-3 w-3 items-center justify-center
|
||||
@@ -308,18 +309,28 @@ const Nav = () => {
|
||||
</span>
|
||||
</Button>
|
||||
|
||||
<Link href="https://app.supabase.com/">
|
||||
<a>
|
||||
<Button type="default" className="hidden lg:block">
|
||||
Sign in
|
||||
</Button>
|
||||
</a>
|
||||
</Link>
|
||||
<Link href="https://app.supabase.com/">
|
||||
<a>
|
||||
<Button className="hidden text-white lg:block">Start your project</Button>
|
||||
</a>
|
||||
</Link>
|
||||
{isLoggedIn ? (
|
||||
<Link href="/dashboard/projects">
|
||||
<a>
|
||||
<Button className="hidden text-white lg:block">Dashboard</Button>
|
||||
</a>
|
||||
</Link>
|
||||
) : (
|
||||
<>
|
||||
<Link href="https://app.supabase.com/">
|
||||
<a>
|
||||
<Button type="default" className="hidden lg:block">
|
||||
Sign in
|
||||
</Button>
|
||||
</a>
|
||||
</Link>
|
||||
<Link href="https://app.supabase.com/">
|
||||
<a>
|
||||
<Button className="hidden text-white lg:block">Start your project</Button>
|
||||
</a>
|
||||
</Link>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{/* <div className="absolute inset-y-0 right-0 flex items-center pr-2 sm:static sm:inset-auto sm:ml-6 sm:pr-0"></div> */}
|
||||
@@ -342,16 +353,16 @@ const Nav = () => {
|
||||
open && '!bg-scale-300',
|
||||
].join(' ')}
|
||||
>
|
||||
<div className="absolute right-4 top-4 items-center justify-between">
|
||||
<div className="absolute items-center justify-between right-4 top-4">
|
||||
<div className="-mr-2">
|
||||
<button
|
||||
onClick={() => setOpen(false)}
|
||||
type="button"
|
||||
className="text-scale-900 focus:ring-brand-900 dark:bg-scale-300 dark:hover:bg-scale-400 inline-flex items-center justify-center rounded-md bg-white p-2 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset"
|
||||
className="inline-flex items-center justify-center p-2 bg-white rounded-md text-scale-900 focus:ring-brand-900 dark:bg-scale-300 dark:hover:bg-scale-400 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset"
|
||||
>
|
||||
<span className="sr-only">Close menu</span>
|
||||
<svg
|
||||
className="h-6 w-6"
|
||||
className="w-6 h-6"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
@@ -370,26 +381,26 @@ const Nav = () => {
|
||||
</div>
|
||||
{/* </div> */}
|
||||
<div className="mt-6 mb-12">
|
||||
<div className="space-y-1 pt-2 pb-4">
|
||||
<div className="pt-2 pb-4 space-y-1">
|
||||
<Link href="https://app.supabase.com/">
|
||||
<a className="text-scale-900 block pl-3 pr-4 text-base font-medium dark:text-white">
|
||||
<a className="block pl-3 pr-4 text-base font-medium text-scale-900 dark:text-white">
|
||||
Sign in
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="space-y-1 pt-2 pb-4">
|
||||
<div className="pt-2 pb-4 space-y-1">
|
||||
<Link href="/docs">
|
||||
<a className="text-scale-900 dark:hover:bg-scale-600 block rounded-md py-2 pl-3 pr-4 text-base font-medium hover:border-gray-300 hover:bg-gray-50 dark:text-white">
|
||||
<a className="block py-2 pl-3 pr-4 text-base font-medium rounded-md text-scale-900 dark:hover:bg-scale-600 hover:border-gray-300 hover:bg-gray-50 dark:text-white">
|
||||
Developers
|
||||
</a>
|
||||
</Link>
|
||||
<Link href="/company">
|
||||
<a className="text-scale-900 dark:hover:bg-scale-600 block rounded-md py-2 pl-3 pr-4 text-base font-medium hover:border-gray-300 hover:bg-gray-50 dark:text-white">
|
||||
<a className="block py-2 pl-3 pr-4 text-base font-medium rounded-md text-scale-900 dark:hover:bg-scale-600 hover:border-gray-300 hover:bg-gray-50 dark:text-white">
|
||||
Company
|
||||
</a>
|
||||
</Link>
|
||||
<Link href="/pricing">
|
||||
<a className="text-scale-900 dark:hover:bg-scale-600 block rounded-md py-2 pl-3 pr-4 text-base font-medium hover:border-gray-300 hover:bg-gray-50 dark:text-white">
|
||||
<a className="block py-2 pl-3 pr-4 text-base font-medium rounded-md text-scale-900 dark:hover:bg-scale-600 hover:border-gray-300 hover:bg-gray-50 dark:text-white">
|
||||
Pricing
|
||||
</a>
|
||||
</Link>
|
||||
@@ -397,7 +408,7 @@ const Nav = () => {
|
||||
<Link href="https://github.com/supabase/supabase">
|
||||
<a
|
||||
target="_blank"
|
||||
className="text-scale-900 dark:hover:bg-scale-600 block rounded-md py-2 pl-3 pr-4 text-base font-medium hover:border-gray-300 hover:bg-gray-50 dark:text-white"
|
||||
className="block py-2 pl-3 pr-4 text-base font-medium rounded-md text-scale-900 dark:hover:bg-scale-600 hover:border-gray-300 hover:bg-gray-50 dark:text-white"
|
||||
>
|
||||
GitHub
|
||||
</a>
|
||||
@@ -405,14 +416,14 @@ const Nav = () => {
|
||||
<Link href="/blog">
|
||||
<a
|
||||
target="_blank"
|
||||
className="text-scale-900 dark:hover:bg-scale-600 block rounded-md py-2 pl-3 pr-4 text-base font-medium hover:border-gray-300 hover:bg-gray-50 dark:text-white"
|
||||
className="block py-2 pl-3 pr-4 text-base font-medium rounded-md text-scale-900 dark:hover:bg-scale-600 hover:border-gray-300 hover:bg-gray-50 dark:text-white"
|
||||
>
|
||||
Blog
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="p-3">
|
||||
<p className="text-scale-900 mb-6 text-sm">Products available:</p>
|
||||
<p className="mb-6 text-sm text-scale-900">Products available:</p>
|
||||
{iconSections}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -36,7 +36,7 @@ function APISection(props: Props) {
|
||||
<div className="grid grid-cols-12 lg:gap-16">
|
||||
<div className="col-span-12 pb-8 lg:col-span-5 xl:col-span-5">
|
||||
<h2 className="h3">{props.title}</h2>
|
||||
<p className="p">{props.text}</p>
|
||||
<div className="p">{props.text}</div>
|
||||
{props.documentation_link && (
|
||||
<Link href={props.documentation_link} as={props.documentation_link}>
|
||||
<a>
|
||||
|
||||
@@ -43,9 +43,7 @@ function TweetCard(props: TweetCard) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<p className="text-scale-1100 mt-3 text-base">"{props.quote}"</p>
|
||||
</p>
|
||||
<p className="text-scale-1100 mt-3 text-base">"{props.quote}"</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"@next/bundle-analyzer": "^13.0.0",
|
||||
"@next/mdx": "^12.3.2",
|
||||
"@supabase/auth-ui-react": "^0.1.6",
|
||||
"@supabase/supabase-js": "^2.0.0",
|
||||
"@supabase/supabase-js": "^2.13.0",
|
||||
"classnames": "^2.3.1",
|
||||
"cobe": "^0.6.2",
|
||||
"common": "*",
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useEffect } from 'react'
|
||||
import Meta from '~/components/Favicons'
|
||||
import '../styles/index.css'
|
||||
import { post } from './../lib/fetchWrapper'
|
||||
import { ThemeProvider } from 'common/Providers'
|
||||
import { AuthProvider, ThemeProvider } from 'common'
|
||||
import Head from 'next/head'
|
||||
|
||||
export default function MyApp({ Component, pageProps }: AppProps) {
|
||||
@@ -63,9 +63,11 @@ export default function MyApp({ Component, pageProps }: AppProps) {
|
||||
cardType: 'summary_large_image',
|
||||
}}
|
||||
/>
|
||||
<ThemeProvider>
|
||||
<Component {...pageProps} />
|
||||
</ThemeProvider>
|
||||
<AuthProvider>
|
||||
<ThemeProvider>
|
||||
<Component {...pageProps} />
|
||||
</ThemeProvider>
|
||||
</AuthProvider>
|
||||
</>
|
||||
)
|
||||
}
|
||||
Generated
+88
-188
@@ -43,9 +43,9 @@
|
||||
"@mdx-js/react": "^1.6.22",
|
||||
"@next/mdx": "^12.0.4",
|
||||
"@radix-ui/react-accordion": "^1.0.1",
|
||||
"@supabase/auth-helpers-nextjs": "^0.5.4",
|
||||
"@supabase/auth-helpers-nextjs": "^0.5.6",
|
||||
"@supabase/auth-helpers-react": "^0.3.1",
|
||||
"@supabase/supabase-js": "^2.8.0",
|
||||
"@supabase/supabase-js": "^2.13.0",
|
||||
"algoliasearch": "^4.14.2",
|
||||
"babel": "^6.23.0",
|
||||
"clsx": "^1.2.1",
|
||||
@@ -403,36 +403,6 @@
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"apps/docs/node_modules/@supabase/gotrue-js": {
|
||||
"version": "2.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.12.1.tgz",
|
||||
"integrity": "sha512-r8Jfq8FvP6q4kp7sI33X1RWfEEHzJFu9uM1Q6HgiDVkY89NNgqYy2kxaRGtidPFllND7vpcJUcpoWS5oq+4u0g==",
|
||||
"dependencies": {
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
},
|
||||
"apps/docs/node_modules/@supabase/realtime-js": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.6.0.tgz",
|
||||
"integrity": "sha512-tOVulMobhpxyDuu8VIImpL8FXmZOKsGNOSyS5ihJdj2xYmPPvYG+D2J51Ewfl+MFF65tweiB6p9N9bNIW1cDNA==",
|
||||
"dependencies": {
|
||||
"@types/phoenix": "^1.5.4",
|
||||
"websocket": "^1.0.34"
|
||||
}
|
||||
},
|
||||
"apps/docs/node_modules/@supabase/supabase-js": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.8.0.tgz",
|
||||
"integrity": "sha512-uzf4J+qAKdUMhB2tnJl6BrQRUQBinwjJ2eWo2ZsDw9EUUP5JcHsxTamiq6p91DpqzmTIRg3xRAT+bItTzbfa0w==",
|
||||
"dependencies": {
|
||||
"@supabase/functions-js": "^2.0.0",
|
||||
"@supabase/gotrue-js": "^2.12.0",
|
||||
"@supabase/postgrest-js": "^1.1.1",
|
||||
"@supabase/realtime-js": "^2.4.0",
|
||||
"@supabase/storage-js": "^2.1.0",
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
},
|
||||
"apps/docs/node_modules/ajv": {
|
||||
"version": "6.12.6",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
||||
@@ -927,7 +897,7 @@
|
||||
"@next/bundle-analyzer": "^13.0.0",
|
||||
"@next/mdx": "^12.3.2",
|
||||
"@supabase/auth-ui-react": "^0.1.6",
|
||||
"@supabase/supabase-js": "^2.0.0",
|
||||
"@supabase/supabase-js": "^2.13.0",
|
||||
"classnames": "^2.3.1",
|
||||
"cobe": "^0.6.2",
|
||||
"common": "*",
|
||||
@@ -9468,11 +9438,11 @@
|
||||
"integrity": "sha512-DKj3U6tS+sCNsSXsoZbOl5gDrAVD3cAZ9QCiVSykLC3iJo085kkmw/3BAACRH54Bq2bN34yySuH6G1SLh2xHXA=="
|
||||
},
|
||||
"node_modules/@supabase/auth-helpers-nextjs": {
|
||||
"version": "0.5.4",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/auth-helpers-nextjs/-/auth-helpers-nextjs-0.5.4.tgz",
|
||||
"integrity": "sha512-Xm3BMDOYPbNyuh8UXDRgBDc3JkeM5S2PfuC1jFJ73CCay4YiH1YxTz06Cvtp+vLH432qdjnqH+49ehVvUehPnQ==",
|
||||
"version": "0.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/auth-helpers-nextjs/-/auth-helpers-nextjs-0.5.6.tgz",
|
||||
"integrity": "sha512-NiUGGnO9vRycMDnl/DzFbHCJhNV9DdH1vH61T1Fzgp2aRW8LfLRVlBQeGCg2AzyvAe0MiLbbRsGNcJmAmJPs9A==",
|
||||
"dependencies": {
|
||||
"@supabase/auth-helpers-shared": "0.2.4"
|
||||
"@supabase/auth-helpers-shared": "0.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@supabase/supabase-js": "^2.0.4"
|
||||
@@ -9487,9 +9457,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@supabase/auth-helpers-shared": {
|
||||
"version": "0.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/auth-helpers-shared/-/auth-helpers-shared-0.2.4.tgz",
|
||||
"integrity": "sha512-c+hi3N6DhjPTzjXGOokre4gmMZOqt0f1ORrwZwi2s07pk3cbkmn77DwwVtlYMNi3oZNYRQqAfxJu83UzpJrrmg==",
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/auth-helpers-shared/-/auth-helpers-shared-0.3.0.tgz",
|
||||
"integrity": "sha512-6lKhVMBZnGdFelpZyvQDBQSOY+pglS6a5U4ieAqfKQ/rx3rSjRASR3UGh7V+el1re3xYe3ddVBWXw16rdVAzrQ==",
|
||||
"peerDependencies": {
|
||||
"@supabase/supabase-js": "^2.0.4"
|
||||
}
|
||||
@@ -9513,17 +9483,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@supabase/functions-js": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.0.0.tgz",
|
||||
"integrity": "sha512-ozb7bds2yvf5k7NM2ZzUkxvsx4S4i2eRKFSJetdTADV91T65g4gCzEs9L3LUXSrghcGIkUaon03VPzOrFredqg==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.1.0.tgz",
|
||||
"integrity": "sha512-vRziB+AqRXRaGHjEFHwBo0kuNDTuAxI7VUeqU24Fe86ISoD8YEQm0dGdpleJEcqgDGWaO6pxT1tfj1BRY5PwMg==",
|
||||
"dependencies": {
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
},
|
||||
"node_modules/@supabase/gotrue-js": {
|
||||
"version": "2.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.10.0.tgz",
|
||||
"integrity": "sha512-3k9zg+TN4rJFVbAWoX1KnOpKthb21HxYu87mBG8ccCXSl3fxnFBJNs898+pksj4fw5E6aM/dVtHHHAfV3MwVRQ==",
|
||||
"version": "2.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.16.0.tgz",
|
||||
"integrity": "sha512-k7curH5xxnQmUiG8AeFW7KEJST99vhFnBCidWFhuSSyLP1Ja8Ix3g4bmLUv209mhX8LmAaDMGKNQs8gG0MOKCw==",
|
||||
"dependencies": {
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
@@ -9576,11 +9546,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@supabase/realtime-js": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.3.1.tgz",
|
||||
"integrity": "sha512-AX4pzZozVPvHAWfPcKl0UWj19pqwogD9TnCEHq1x/6oQjVoqA3n6H+1Ea2of9MheSroajHguaQMen3xLEoWrug==",
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.7.1.tgz",
|
||||
"integrity": "sha512-WC0yPArBF/wPXwxKWTrRSMWWnFQCbhhUsX0u42x4OqUdDJtow6rzvDIZHWFZLh85UUBYIQ2++AabSNgzd3ubQg==",
|
||||
"dependencies": {
|
||||
"@types/phoenix": "^1.5.4",
|
||||
"@types/websocket": "^1.0.3",
|
||||
"websocket": "^1.0.34"
|
||||
}
|
||||
},
|
||||
@@ -9590,23 +9561,23 @@
|
||||
"integrity": "sha512-qP1N39xRhi00L6g0FYJCWKAbPQbiVsMP/E3y5zdivOiL2VUFkbLKXYfvzzwhGj3eKdr7O/N/2VtZXWXm+DCx0g=="
|
||||
},
|
||||
"node_modules/@supabase/storage-js": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.3.0.tgz",
|
||||
"integrity": "sha512-YGWVCEYYYF3+UiyL8O4xC78N9n9paLbT0hHl8dmYAtd3DqyWtu5Eph9JTu0PWm+/29Zhns5TbhUZW4xpWjJfPQ==",
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.3.1.tgz",
|
||||
"integrity": "sha512-BaPIvyvjuZW1V0CnfGKUZyzpBUXnsh0XD8eqTOYd+MdiGPmIPI0vtwnT4fAoK8mipp1vpcN62EVQaqeUnWXPtQ==",
|
||||
"dependencies": {
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
},
|
||||
"node_modules/@supabase/supabase-js": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.4.1.tgz",
|
||||
"integrity": "sha512-nFePO2yKVip3VI+OyfUOxhv0IyMmZDeieFJS39y84evPOM9zuZomEmkhwnmEWrLFI7hSr+o2QvY4P+q3c2MbGQ==",
|
||||
"version": "2.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.13.0.tgz",
|
||||
"integrity": "sha512-D37k5BIwYa4/XNe9eEPz8W0L8MS5w0j16wFDd0twClJC/z+wA4tbcaeWm5Q8IsMeExPa0LrdSrQwPI5bBg6trg==",
|
||||
"dependencies": {
|
||||
"@supabase/functions-js": "^2.0.0",
|
||||
"@supabase/gotrue-js": "^2.7.2",
|
||||
"@supabase/functions-js": "^2.1.0",
|
||||
"@supabase/gotrue-js": "^2.16.0",
|
||||
"@supabase/postgrest-js": "^1.1.1",
|
||||
"@supabase/realtime-js": "^2.3.1",
|
||||
"@supabase/storage-js": "^2.1.0",
|
||||
"@supabase/realtime-js": "^2.7.1",
|
||||
"@supabase/storage-js": "^2.3.1",
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
},
|
||||
@@ -10182,9 +10153,9 @@
|
||||
"integrity": "sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw=="
|
||||
},
|
||||
"node_modules/@types/phoenix": {
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.5.4.tgz",
|
||||
"integrity": "sha512-L5eZmzw89eXBKkiqVBcJfU1QGx9y+wurRIEgt0cuLH0hwNtVUxtx+6cu0R2STwWj468sjXyBYPYDtGclUd1kjQ=="
|
||||
"version": "1.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.5.5.tgz",
|
||||
"integrity": "sha512-1eWWT19k0L4ZiTvdXjAvJ9KvW0B8SdiVftQmFPJGTEx78Q4PCSIQDpz+EfkFVR1N4U9gREjlW4JXL8YCIlY0bw=="
|
||||
},
|
||||
"node_modules/@types/prettier": {
|
||||
"version": "2.7.1",
|
||||
@@ -10453,6 +10424,14 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/websocket": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.5.tgz",
|
||||
"integrity": "sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ==",
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/yargs": {
|
||||
"version": "15.0.14",
|
||||
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.14.tgz",
|
||||
@@ -38264,6 +38243,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@headlessui/react": "^1.5.0",
|
||||
"@supabase/gotrue-js": "^2.16.0",
|
||||
"@supabase/ui": "^0.37.0-alpha.50"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -38436,7 +38416,7 @@
|
||||
"@stripe/stripe-js": "^1.25.0",
|
||||
"@supabase/react-data-grid": "^7.1.0-beta.7",
|
||||
"@supabase/shared-types": "^0.1.40",
|
||||
"@supabase/supabase-js": "^2.8.0",
|
||||
"@supabase/supabase-js": "^2.13.0",
|
||||
"@tanstack/react-query": "^4.22.0",
|
||||
"@tanstack/react-query-devtools": "^4.22.0",
|
||||
"@zip.js/zip.js": "^2.6.61",
|
||||
@@ -38760,36 +38740,6 @@
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"studio/node_modules/@supabase/gotrue-js": {
|
||||
"version": "2.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.12.1.tgz",
|
||||
"integrity": "sha512-r8Jfq8FvP6q4kp7sI33X1RWfEEHzJFu9uM1Q6HgiDVkY89NNgqYy2kxaRGtidPFllND7vpcJUcpoWS5oq+4u0g==",
|
||||
"dependencies": {
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
},
|
||||
"studio/node_modules/@supabase/realtime-js": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.6.0.tgz",
|
||||
"integrity": "sha512-tOVulMobhpxyDuu8VIImpL8FXmZOKsGNOSyS5ihJdj2xYmPPvYG+D2J51Ewfl+MFF65tweiB6p9N9bNIW1cDNA==",
|
||||
"dependencies": {
|
||||
"@types/phoenix": "^1.5.4",
|
||||
"websocket": "^1.0.34"
|
||||
}
|
||||
},
|
||||
"studio/node_modules/@supabase/supabase-js": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.8.0.tgz",
|
||||
"integrity": "sha512-uzf4J+qAKdUMhB2tnJl6BrQRUQBinwjJ2eWo2ZsDw9EUUP5JcHsxTamiq6p91DpqzmTIRg3xRAT+bItTzbfa0w==",
|
||||
"dependencies": {
|
||||
"@supabase/functions-js": "^2.0.0",
|
||||
"@supabase/gotrue-js": "^2.12.0",
|
||||
"@supabase/postgrest-js": "^1.1.1",
|
||||
"@supabase/realtime-js": "^2.4.0",
|
||||
"@supabase/storage-js": "^2.1.0",
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
},
|
||||
"studio/node_modules/@tailwindcss/typography": {
|
||||
"version": "0.5.8",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.8.tgz",
|
||||
@@ -39285,7 +39235,7 @@
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@faker-js/faker": "^6.1.2",
|
||||
"@supabase/supabase-js": "^2.0.0",
|
||||
"@supabase/supabase-js": "^2.13.0",
|
||||
"@testdeck/jest": "^0.2.0",
|
||||
"@types/jest": "^27.4.0",
|
||||
"@types/node": "^17.0.24",
|
||||
@@ -45589,11 +45539,11 @@
|
||||
"integrity": "sha512-DKj3U6tS+sCNsSXsoZbOl5gDrAVD3cAZ9QCiVSykLC3iJo085kkmw/3BAACRH54Bq2bN34yySuH6G1SLh2xHXA=="
|
||||
},
|
||||
"@supabase/auth-helpers-nextjs": {
|
||||
"version": "0.5.4",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/auth-helpers-nextjs/-/auth-helpers-nextjs-0.5.4.tgz",
|
||||
"integrity": "sha512-Xm3BMDOYPbNyuh8UXDRgBDc3JkeM5S2PfuC1jFJ73CCay4YiH1YxTz06Cvtp+vLH432qdjnqH+49ehVvUehPnQ==",
|
||||
"version": "0.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/auth-helpers-nextjs/-/auth-helpers-nextjs-0.5.6.tgz",
|
||||
"integrity": "sha512-NiUGGnO9vRycMDnl/DzFbHCJhNV9DdH1vH61T1Fzgp2aRW8LfLRVlBQeGCg2AzyvAe0MiLbbRsGNcJmAmJPs9A==",
|
||||
"requires": {
|
||||
"@supabase/auth-helpers-shared": "0.2.4"
|
||||
"@supabase/auth-helpers-shared": "0.3.0"
|
||||
}
|
||||
},
|
||||
"@supabase/auth-helpers-react": {
|
||||
@@ -45603,9 +45553,9 @@
|
||||
"requires": {}
|
||||
},
|
||||
"@supabase/auth-helpers-shared": {
|
||||
"version": "0.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/auth-helpers-shared/-/auth-helpers-shared-0.2.4.tgz",
|
||||
"integrity": "sha512-c+hi3N6DhjPTzjXGOokre4gmMZOqt0f1ORrwZwi2s07pk3cbkmn77DwwVtlYMNi3oZNYRQqAfxJu83UzpJrrmg==",
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/auth-helpers-shared/-/auth-helpers-shared-0.3.0.tgz",
|
||||
"integrity": "sha512-6lKhVMBZnGdFelpZyvQDBQSOY+pglS6a5U4ieAqfKQ/rx3rSjRASR3UGh7V+el1re3xYe3ddVBWXw16rdVAzrQ==",
|
||||
"requires": {}
|
||||
},
|
||||
"@supabase/auth-ui-react": {
|
||||
@@ -45621,17 +45571,17 @@
|
||||
}
|
||||
},
|
||||
"@supabase/functions-js": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.0.0.tgz",
|
||||
"integrity": "sha512-ozb7bds2yvf5k7NM2ZzUkxvsx4S4i2eRKFSJetdTADV91T65g4gCzEs9L3LUXSrghcGIkUaon03VPzOrFredqg==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.1.0.tgz",
|
||||
"integrity": "sha512-vRziB+AqRXRaGHjEFHwBo0kuNDTuAxI7VUeqU24Fe86ISoD8YEQm0dGdpleJEcqgDGWaO6pxT1tfj1BRY5PwMg==",
|
||||
"requires": {
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
},
|
||||
"@supabase/gotrue-js": {
|
||||
"version": "2.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.10.0.tgz",
|
||||
"integrity": "sha512-3k9zg+TN4rJFVbAWoX1KnOpKthb21HxYu87mBG8ccCXSl3fxnFBJNs898+pksj4fw5E6aM/dVtHHHAfV3MwVRQ==",
|
||||
"version": "2.16.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.16.0.tgz",
|
||||
"integrity": "sha512-k7curH5xxnQmUiG8AeFW7KEJST99vhFnBCidWFhuSSyLP1Ja8Ix3g4bmLUv209mhX8LmAaDMGKNQs8gG0MOKCw==",
|
||||
"requires": {
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
@@ -45675,11 +45625,12 @@
|
||||
}
|
||||
},
|
||||
"@supabase/realtime-js": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.3.1.tgz",
|
||||
"integrity": "sha512-AX4pzZozVPvHAWfPcKl0UWj19pqwogD9TnCEHq1x/6oQjVoqA3n6H+1Ea2of9MheSroajHguaQMen3xLEoWrug==",
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.7.1.tgz",
|
||||
"integrity": "sha512-WC0yPArBF/wPXwxKWTrRSMWWnFQCbhhUsX0u42x4OqUdDJtow6rzvDIZHWFZLh85UUBYIQ2++AabSNgzd3ubQg==",
|
||||
"requires": {
|
||||
"@types/phoenix": "^1.5.4",
|
||||
"@types/websocket": "^1.0.3",
|
||||
"websocket": "^1.0.34"
|
||||
}
|
||||
},
|
||||
@@ -45689,23 +45640,23 @@
|
||||
"integrity": "sha512-qP1N39xRhi00L6g0FYJCWKAbPQbiVsMP/E3y5zdivOiL2VUFkbLKXYfvzzwhGj3eKdr7O/N/2VtZXWXm+DCx0g=="
|
||||
},
|
||||
"@supabase/storage-js": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.3.0.tgz",
|
||||
"integrity": "sha512-YGWVCEYYYF3+UiyL8O4xC78N9n9paLbT0hHl8dmYAtd3DqyWtu5Eph9JTu0PWm+/29Zhns5TbhUZW4xpWjJfPQ==",
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.3.1.tgz",
|
||||
"integrity": "sha512-BaPIvyvjuZW1V0CnfGKUZyzpBUXnsh0XD8eqTOYd+MdiGPmIPI0vtwnT4fAoK8mipp1vpcN62EVQaqeUnWXPtQ==",
|
||||
"requires": {
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
},
|
||||
"@supabase/supabase-js": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.4.1.tgz",
|
||||
"integrity": "sha512-nFePO2yKVip3VI+OyfUOxhv0IyMmZDeieFJS39y84evPOM9zuZomEmkhwnmEWrLFI7hSr+o2QvY4P+q3c2MbGQ==",
|
||||
"version": "2.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.13.0.tgz",
|
||||
"integrity": "sha512-D37k5BIwYa4/XNe9eEPz8W0L8MS5w0j16wFDd0twClJC/z+wA4tbcaeWm5Q8IsMeExPa0LrdSrQwPI5bBg6trg==",
|
||||
"requires": {
|
||||
"@supabase/functions-js": "^2.0.0",
|
||||
"@supabase/gotrue-js": "^2.7.2",
|
||||
"@supabase/functions-js": "^2.1.0",
|
||||
"@supabase/gotrue-js": "^2.16.0",
|
||||
"@supabase/postgrest-js": "^1.1.1",
|
||||
"@supabase/realtime-js": "^2.3.1",
|
||||
"@supabase/storage-js": "^2.1.0",
|
||||
"@supabase/realtime-js": "^2.7.1",
|
||||
"@supabase/storage-js": "^2.3.1",
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
},
|
||||
@@ -46230,9 +46181,9 @@
|
||||
"integrity": "sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw=="
|
||||
},
|
||||
"@types/phoenix": {
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.5.4.tgz",
|
||||
"integrity": "sha512-L5eZmzw89eXBKkiqVBcJfU1QGx9y+wurRIEgt0cuLH0hwNtVUxtx+6cu0R2STwWj468sjXyBYPYDtGclUd1kjQ=="
|
||||
"version": "1.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.5.5.tgz",
|
||||
"integrity": "sha512-1eWWT19k0L4ZiTvdXjAvJ9KvW0B8SdiVftQmFPJGTEx78Q4PCSIQDpz+EfkFVR1N4U9gREjlW4JXL8YCIlY0bw=="
|
||||
},
|
||||
"@types/prettier": {
|
||||
"version": "2.7.1",
|
||||
@@ -46498,6 +46449,14 @@
|
||||
"source-map": "^0.7.3"
|
||||
}
|
||||
},
|
||||
"@types/websocket": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.5.tgz",
|
||||
"integrity": "sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ==",
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"@types/yargs": {
|
||||
"version": "15.0.14",
|
||||
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.14.tgz",
|
||||
@@ -49009,6 +48968,7 @@
|
||||
"version": "file:packages/common",
|
||||
"requires": {
|
||||
"@headlessui/react": "^1.5.0",
|
||||
"@supabase/gotrue-js": "^2.16.0",
|
||||
"@supabase/ui": "^0.37.0-alpha.50",
|
||||
"@types/react": "^17.0.37",
|
||||
"@types/react-dom": "^17.0.11",
|
||||
@@ -50949,9 +50909,9 @@
|
||||
"@mdx-js/react": "^1.6.22",
|
||||
"@next/mdx": "^12.0.4",
|
||||
"@radix-ui/react-accordion": "^1.0.1",
|
||||
"@supabase/auth-helpers-nextjs": "^0.5.4",
|
||||
"@supabase/auth-helpers-nextjs": "^0.5.6",
|
||||
"@supabase/auth-helpers-react": "^0.3.1",
|
||||
"@supabase/supabase-js": "^2.8.0",
|
||||
"@supabase/supabase-js": "^2.13.0",
|
||||
"@types/node": "^17.0.12",
|
||||
"@types/react": "17.0.39",
|
||||
"algoliasearch": "^4.14.2",
|
||||
@@ -51177,36 +51137,6 @@
|
||||
"integrity": "sha512-tpQJYUH+TzPMIsdVl9fH8uDg47iwiNjKY+8e9da3dXqlkztKzjSw0OwSADoqh3KrifplXeKSta+BBGLdBqg3sg==",
|
||||
"optional": true
|
||||
},
|
||||
"@supabase/gotrue-js": {
|
||||
"version": "2.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.12.1.tgz",
|
||||
"integrity": "sha512-r8Jfq8FvP6q4kp7sI33X1RWfEEHzJFu9uM1Q6HgiDVkY89NNgqYy2kxaRGtidPFllND7vpcJUcpoWS5oq+4u0g==",
|
||||
"requires": {
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
},
|
||||
"@supabase/realtime-js": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.6.0.tgz",
|
||||
"integrity": "sha512-tOVulMobhpxyDuu8VIImpL8FXmZOKsGNOSyS5ihJdj2xYmPPvYG+D2J51Ewfl+MFF65tweiB6p9N9bNIW1cDNA==",
|
||||
"requires": {
|
||||
"@types/phoenix": "^1.5.4",
|
||||
"websocket": "^1.0.34"
|
||||
}
|
||||
},
|
||||
"@supabase/supabase-js": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.8.0.tgz",
|
||||
"integrity": "sha512-uzf4J+qAKdUMhB2tnJl6BrQRUQBinwjJ2eWo2ZsDw9EUUP5JcHsxTamiq6p91DpqzmTIRg3xRAT+bItTzbfa0w==",
|
||||
"requires": {
|
||||
"@supabase/functions-js": "^2.0.0",
|
||||
"@supabase/gotrue-js": "^2.12.0",
|
||||
"@supabase/postgrest-js": "^1.1.1",
|
||||
"@supabase/realtime-js": "^2.4.0",
|
||||
"@supabase/storage-js": "^2.1.0",
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
},
|
||||
"ajv": {
|
||||
"version": "6.12.6",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
||||
@@ -65344,7 +65274,7 @@
|
||||
"@supabase/postgres-meta": "^0.60.7",
|
||||
"@supabase/react-data-grid": "^7.1.0-beta.7",
|
||||
"@supabase/shared-types": "^0.1.40",
|
||||
"@supabase/supabase-js": "^2.8.0",
|
||||
"@supabase/supabase-js": "^2.13.0",
|
||||
"@tailwindcss/typography": "^0.5.2",
|
||||
"@tanstack/react-query": "^4.22.0",
|
||||
"@tanstack/react-query-devtools": "^4.22.0",
|
||||
@@ -65539,36 +65469,6 @@
|
||||
"integrity": "sha512-tpQJYUH+TzPMIsdVl9fH8uDg47iwiNjKY+8e9da3dXqlkztKzjSw0OwSADoqh3KrifplXeKSta+BBGLdBqg3sg==",
|
||||
"optional": true
|
||||
},
|
||||
"@supabase/gotrue-js": {
|
||||
"version": "2.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.12.1.tgz",
|
||||
"integrity": "sha512-r8Jfq8FvP6q4kp7sI33X1RWfEEHzJFu9uM1Q6HgiDVkY89NNgqYy2kxaRGtidPFllND7vpcJUcpoWS5oq+4u0g==",
|
||||
"requires": {
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
},
|
||||
"@supabase/realtime-js": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.6.0.tgz",
|
||||
"integrity": "sha512-tOVulMobhpxyDuu8VIImpL8FXmZOKsGNOSyS5ihJdj2xYmPPvYG+D2J51Ewfl+MFF65tweiB6p9N9bNIW1cDNA==",
|
||||
"requires": {
|
||||
"@types/phoenix": "^1.5.4",
|
||||
"websocket": "^1.0.34"
|
||||
}
|
||||
},
|
||||
"@supabase/supabase-js": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.8.0.tgz",
|
||||
"integrity": "sha512-uzf4J+qAKdUMhB2tnJl6BrQRUQBinwjJ2eWo2ZsDw9EUUP5JcHsxTamiq6p91DpqzmTIRg3xRAT+bItTzbfa0w==",
|
||||
"requires": {
|
||||
"@supabase/functions-js": "^2.0.0",
|
||||
"@supabase/gotrue-js": "^2.12.0",
|
||||
"@supabase/postgrest-js": "^1.1.1",
|
||||
"@supabase/realtime-js": "^2.4.0",
|
||||
"@supabase/storage-js": "^2.1.0",
|
||||
"cross-fetch": "^3.1.5"
|
||||
}
|
||||
},
|
||||
"@tailwindcss/typography": {
|
||||
"version": "0.5.8",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.8.tgz",
|
||||
@@ -65976,7 +65876,7 @@
|
||||
"version": "file:tests",
|
||||
"requires": {
|
||||
"@faker-js/faker": "^6.1.2",
|
||||
"@supabase/supabase-js": "^2.0.0",
|
||||
"@supabase/supabase-js": "^2.13.0",
|
||||
"@testdeck/jest": "^0.2.0",
|
||||
"@types/jest": "^27.4.0",
|
||||
"@types/node": "^17.0.24",
|
||||
@@ -68644,7 +68544,7 @@
|
||||
"@next/bundle-analyzer": "^13.0.0",
|
||||
"@next/mdx": "^12.3.2",
|
||||
"@supabase/auth-ui-react": "^0.1.6",
|
||||
"@supabase/supabase-js": "^2.0.0",
|
||||
"@supabase/supabase-js": "^2.13.0",
|
||||
"@tailwindcss/typography": "^0.5.7",
|
||||
"@types/classnames": "^2.3.1",
|
||||
"@types/jest": "^25.2.2",
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
import { Session } from '@supabase/supabase-js'
|
||||
import {
|
||||
createContext,
|
||||
PropsWithChildren,
|
||||
useCallback,
|
||||
useContext,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useState,
|
||||
} from 'react'
|
||||
import { gotrueClient } from './gotrue'
|
||||
|
||||
const DEFAULT_SESSION: any = {
|
||||
access_token: undefined,
|
||||
expires_at: 0,
|
||||
expires_in: 0,
|
||||
refresh_token: '',
|
||||
token_type: '',
|
||||
user: {
|
||||
aud: '',
|
||||
app_metadata: {},
|
||||
confirmed_at: '',
|
||||
created_at: '',
|
||||
email: '',
|
||||
email_confirmed_at: '',
|
||||
id: '',
|
||||
identities: [],
|
||||
last_signed_in_at: '',
|
||||
phone: '',
|
||||
role: '',
|
||||
updated_at: '',
|
||||
user_metadata: {},
|
||||
},
|
||||
} as unknown as Session
|
||||
|
||||
/* Auth Context */
|
||||
|
||||
type AuthState =
|
||||
| {
|
||||
session: Session | null
|
||||
isLoading: false
|
||||
}
|
||||
| {
|
||||
session: null
|
||||
isLoading: true
|
||||
}
|
||||
|
||||
export type AuthContext = { refreshSession: () => Promise<Session | null> } & AuthState
|
||||
|
||||
export const AuthContext = createContext<AuthContext>({
|
||||
session: null,
|
||||
isLoading: true,
|
||||
refreshSession: () => Promise.resolve(null),
|
||||
})
|
||||
|
||||
export type AuthProviderProps = {
|
||||
alwaysLoggedIn?: boolean
|
||||
}
|
||||
|
||||
export const AuthProvider = ({
|
||||
alwaysLoggedIn,
|
||||
children,
|
||||
}: PropsWithChildren<AuthProviderProps>) => {
|
||||
const [state, setState] = useState<AuthState>({ session: null, isLoading: true })
|
||||
|
||||
// Keep the session in sync
|
||||
useEffect(() => {
|
||||
const {
|
||||
data: { subscription },
|
||||
} = gotrueClient.onAuthStateChange((_event, session) => {
|
||||
setState({ session, isLoading: false })
|
||||
})
|
||||
|
||||
return subscription.unsubscribe
|
||||
}, [])
|
||||
|
||||
// Helper method to refresh the session.
|
||||
// For example after a user updates their profile
|
||||
const refreshSession = useCallback(async () => {
|
||||
const {
|
||||
data: { session },
|
||||
} = await gotrueClient.refreshSession()
|
||||
|
||||
return session
|
||||
}, [])
|
||||
|
||||
const value = useMemo(() => {
|
||||
if (alwaysLoggedIn) {
|
||||
return { session: DEFAULT_SESSION, isLoading: false, refreshSession } as const
|
||||
} else {
|
||||
return { ...state, refreshSession } as const
|
||||
}
|
||||
}, [state, refreshSession])
|
||||
|
||||
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>
|
||||
}
|
||||
|
||||
/* Auth Utils */
|
||||
|
||||
export const useAuth = () => useContext(AuthContext)
|
||||
|
||||
export const useSession = () => useAuth().session
|
||||
|
||||
export const useUser = () => useSession()?.user ?? null
|
||||
|
||||
export const useIsLoggedIn = () => {
|
||||
const user = useUser()
|
||||
|
||||
return user !== null
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { GoTrueClient } from '@supabase/gotrue-js'
|
||||
|
||||
export const STORAGE_KEY = process.env.NEXT_PUBLIC_STORAGE_KEY || 'supabase.dashboard.auth.token'
|
||||
|
||||
export const gotrueClient = new GoTrueClient({
|
||||
url: process.env.NEXT_PUBLIC_GOTRUE_URL,
|
||||
storageKey: STORAGE_KEY,
|
||||
detectSessionInUrl: true,
|
||||
})
|
||||
@@ -1,9 +1,9 @@
|
||||
import React from 'react'
|
||||
|
||||
import SidebarLayout from './layouts/SidebarLayout'
|
||||
|
||||
export * from './Button'
|
||||
export * from './Providers'
|
||||
export * from './gotrue'
|
||||
export * from './auth'
|
||||
|
||||
export const Layouts = {
|
||||
SidebarLayout,
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@headlessui/react": "^1.5.0",
|
||||
"@supabase/gotrue-js": "^2.16.0",
|
||||
"@supabase/ui": "^0.37.0-alpha.50"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
+12
-132
@@ -1,71 +1,23 @@
|
||||
import { Session } from '@supabase/supabase-js'
|
||||
import {
|
||||
AuthContext as AuthContextInternal,
|
||||
AuthProvider as AuthProviderInternal,
|
||||
AuthProviderProps,
|
||||
gotrueClient,
|
||||
} from 'common'
|
||||
import { useProfileQuery } from 'data/profile/profile-query'
|
||||
import { useStore } from 'hooks'
|
||||
import { auth } from 'lib/gotrue'
|
||||
import {
|
||||
createContext,
|
||||
PropsWithChildren,
|
||||
useCallback,
|
||||
useContext,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useState,
|
||||
} from 'react'
|
||||
import { PropsWithChildren, useEffect } from 'react'
|
||||
import { GOTRUE_ERRORS, IS_PLATFORM } from './constants'
|
||||
|
||||
const DEFAULT_SESSION: any = {
|
||||
access_token: undefined,
|
||||
expires_at: 0,
|
||||
expires_in: 0,
|
||||
refresh_token: '',
|
||||
token_type: '',
|
||||
user: {
|
||||
aud: '',
|
||||
app_metadata: {},
|
||||
confirmed_at: '',
|
||||
created_at: '',
|
||||
email: '',
|
||||
email_confirmed_at: '',
|
||||
id: '',
|
||||
identities: [],
|
||||
last_signed_in_at: '',
|
||||
phone: '',
|
||||
role: '',
|
||||
updated_at: '',
|
||||
user_metadata: {},
|
||||
},
|
||||
}
|
||||
export const AuthContext = AuthContextInternal
|
||||
|
||||
/* Auth Context */
|
||||
|
||||
export type AuthContext = { refreshSession: () => Promise<Session | null> } & (
|
||||
| {
|
||||
session: Session
|
||||
isLoading: false
|
||||
}
|
||||
| {
|
||||
session: null
|
||||
isLoading: boolean
|
||||
}
|
||||
)
|
||||
|
||||
export const AuthContext = createContext<AuthContext>({
|
||||
session: null,
|
||||
isLoading: true,
|
||||
refreshSession: () => Promise.resolve(null),
|
||||
})
|
||||
|
||||
export type AuthProviderProps = {}
|
||||
|
||||
export const AuthProvider = ({ children }: PropsWithChildren<AuthProviderProps>) => {
|
||||
export const AuthProvider = ({ children }: PropsWithChildren<{}>) => {
|
||||
const { ui, app } = useStore()
|
||||
const [session, setSession] = useState<Session | null>(null)
|
||||
const [isLoading, setIsLoading] = useState(true)
|
||||
|
||||
// Check for unverified GitHub users after a GitHub sign in
|
||||
useEffect(() => {
|
||||
async function handleEmailVerificationError() {
|
||||
const { error } = await auth.initialize()
|
||||
const { error } = await gotrueClient.initialize()
|
||||
|
||||
if (error?.message === GOTRUE_ERRORS.UNVERIFIED_GITHUB_USER) {
|
||||
ui.setNotification({
|
||||
@@ -79,44 +31,6 @@ export const AuthProvider = ({ children }: PropsWithChildren<AuthProviderProps>)
|
||||
handleEmailVerificationError()
|
||||
}, [])
|
||||
|
||||
// Setup a possible existing session
|
||||
useEffect(() => {
|
||||
let mounted = true
|
||||
|
||||
auth
|
||||
.getSession()
|
||||
.then(({ data: { session } }) => {
|
||||
if (mounted) {
|
||||
if (session) {
|
||||
setSession(session)
|
||||
}
|
||||
|
||||
setIsLoading(false)
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
if (mounted) {
|
||||
setIsLoading(false)
|
||||
}
|
||||
})
|
||||
|
||||
return () => {
|
||||
mounted = false
|
||||
}
|
||||
}, [])
|
||||
|
||||
// Keep the session in sync
|
||||
useEffect(() => {
|
||||
const {
|
||||
data: { subscription },
|
||||
} = auth.onAuthStateChange((_event, session) => {
|
||||
setSession(session)
|
||||
setIsLoading(false)
|
||||
})
|
||||
|
||||
return subscription.unsubscribe
|
||||
}, [])
|
||||
|
||||
// Track telemetry for the current user
|
||||
useProfileQuery({
|
||||
onSuccess(profile) {
|
||||
@@ -133,41 +47,7 @@ export const AuthProvider = ({ children }: PropsWithChildren<AuthProviderProps>)
|
||||
cacheTime: Infinity,
|
||||
})
|
||||
|
||||
// Helper method to refresh the session.
|
||||
// For example after a user updates their profile
|
||||
const refreshSession = useCallback(async () => {
|
||||
const {
|
||||
data: { session },
|
||||
} = await auth.refreshSession()
|
||||
|
||||
return session
|
||||
}, [])
|
||||
|
||||
const value = useMemo(() => {
|
||||
if (IS_PLATFORM) {
|
||||
if (session) {
|
||||
return { session, isLoading: false, refreshSession } as const
|
||||
} else {
|
||||
return { session: null, isLoading: isLoading, refreshSession } as const
|
||||
}
|
||||
} else {
|
||||
return { session: DEFAULT_SESSION, isLoading: false, refreshSession } as const
|
||||
}
|
||||
}, [session, isLoading, refreshSession])
|
||||
|
||||
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>
|
||||
return <AuthProviderInternal alwaysLoggedIn={!IS_PLATFORM}>{children}</AuthProviderInternal>
|
||||
}
|
||||
|
||||
/* Auth Utils */
|
||||
|
||||
export const useAuth = () => useContext(AuthContext)
|
||||
|
||||
export const useSession = () => useAuth().session
|
||||
|
||||
export const useUser = () => useSession()?.user ?? null
|
||||
|
||||
export const useIsLoggedIn = () => {
|
||||
const user = useUser()
|
||||
|
||||
return user !== null
|
||||
}
|
||||
export { useAuth, useIsLoggedIn, useSession, useUser } from 'common'
|
||||
@@ -1,12 +1,8 @@
|
||||
import { GoTrueClient, User } from '@supabase/gotrue-js'
|
||||
import { User } from '@supabase/gotrue-js'
|
||||
import { gotrueClient } from 'common'
|
||||
export { STORAGE_KEY } from 'common'
|
||||
|
||||
export const STORAGE_KEY = process.env.NEXT_PUBLIC_STORAGE_KEY || 'supabase.dashboard.auth.token'
|
||||
|
||||
export const auth = new GoTrueClient({
|
||||
url: process.env.NEXT_PUBLIC_GOTRUE_URL,
|
||||
storageKey: STORAGE_KEY,
|
||||
detectSessionInUrl: true,
|
||||
})
|
||||
export const auth = gotrueClient
|
||||
|
||||
export const getAuthUser = async (token: String): Promise<any> => {
|
||||
try {
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@
|
||||
"@stripe/stripe-js": "^1.25.0",
|
||||
"@supabase/react-data-grid": "^7.1.0-beta.7",
|
||||
"@supabase/shared-types": "^0.1.40",
|
||||
"@supabase/supabase-js": "^2.8.0",
|
||||
"@supabase/supabase-js": "^2.13.0",
|
||||
"@tanstack/react-query": "^4.22.0",
|
||||
"@tanstack/react-query-devtools": "^4.22.0",
|
||||
"@zip.js/zip.js": "^2.6.61",
|
||||
|
||||
Generated
-9798
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -18,7 +18,7 @@
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@faker-js/faker": "^6.1.2",
|
||||
"@supabase/supabase-js": "^2.0.0",
|
||||
"@supabase/supabase-js": "^2.13.0",
|
||||
"@testdeck/jest": "^0.2.0",
|
||||
"@types/jest": "^27.4.0",
|
||||
"@types/node": "^17.0.24",
|
||||
|
||||
Reference in new issue
Block a user