mirror of
https://github.com/supabase/supabase.git
synced 2026-10-15 14:19:11 +03:00
Merge branch 'master' into fix/studio-logs-hide-search-input-when-custom-mode
This commit is contained in:
commit
1607fbf985
9 files changed
+73
-25
No files matched your search
+2
-2
@@ -3,8 +3,8 @@
|
||||
|
||||
POSTGRES_PASSWORD=your-super-secret-and-long-postgres-password
|
||||
JWT_SECRET=your-super-secret-jwt-token-with-at-least-32-characters-long
|
||||
ANON_KEY=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYyNzIwODU0MCwiZXhwIjoxOTc0MzYzNzQwfQ.zcaQfHd3VA7XgJmdGfmV86OLVJT9s2MTmSy-e69BpUY
|
||||
SERVICE_ROLE_KEY=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIiwiaWF0IjoxNjI3MjA4NTQwLCJleHAiOjE5NzQzNjM3NDB9.pkT3PNpO4DtO45Ac5HK_TKCx8sGLgNtV__pr_ZrRSAU
|
||||
ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE
|
||||
SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q
|
||||
|
||||
# Auth
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ _format_version: "1.1"
|
||||
consumers:
|
||||
- username: anon
|
||||
keyauth_credentials:
|
||||
- key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYyNzIwODU0MCwiZXhwIjoxOTc0MzYzNzQwfQ.zcaQfHd3VA7XgJmdGfmV86OLVJT9s2MTmSy-e69BpUY
|
||||
- key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE
|
||||
- username: service_role
|
||||
keyauth_credentials:
|
||||
- key: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIiwiaWF0IjoxNjI3MjA4NTQwLCJleHAiOjE5NzQzNjM3NDB9.pkT3PNpO4DtO45Ac5HK_TKCx8sGLgNtV__pr_ZrRSAU
|
||||
- key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q
|
||||
|
||||
###
|
||||
### Access Control List
|
||||
|
||||
+2
-2
@@ -2,5 +2,5 @@ STUDIO_PG_META_URL=http://localhost:8000/pg
|
||||
POSTGRES_PASSWORD=your-super-secret-and-long-postgres-password
|
||||
|
||||
SUPABASE_URL=http://localhost:8000
|
||||
SUPABASE_ANON_KEY=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYyNzIwODU0MCwiZXhwIjoxOTc0MzYzNzQwfQ.zcaQfHd3VA7XgJmdGfmV86OLVJT9s2MTmSy-e69BpUY
|
||||
SUPABASE_SERVICE_KEY=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIiwiaWF0IjoxNjI3MjA4NTQwLCJleHAiOjE5NzQzNjM3NDB9.pkT3PNpO4DtO45Ac5HK_TKCx8sGLgNtV__pr_ZrRSAU
|
||||
SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE
|
||||
SUPABASE_SERVICE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useState } from 'react'
|
||||
import { observer } from 'mobx-react-lite'
|
||||
import { Button, Typography } from '@supabase/ui'
|
||||
import Router from 'next/router'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
import { API_URL } from 'lib/constants'
|
||||
import { useStore, withAuth } from 'hooks'
|
||||
@@ -15,6 +15,8 @@ import Panel from 'components/to-be-cleaned/Panel'
|
||||
*/
|
||||
const Wizard = () => {
|
||||
const { ui, app } = useStore()
|
||||
const router = useRouter()
|
||||
|
||||
const [orgName, setOrgName] = useState('')
|
||||
const [newOrgLoading, setNewOrgLoading] = useState(false)
|
||||
|
||||
@@ -49,11 +51,7 @@ const Wizard = () => {
|
||||
} else {
|
||||
const org = response
|
||||
app.onOrgAdded(org)
|
||||
|
||||
// Router.push('/new/[slug]', `/new/${org.slug}`)
|
||||
// Using window.location.href for now as organization metadata needs to refresh
|
||||
// We do not get is_owner nor stripe_customer_id from the response here
|
||||
window.location.href = `/new/${org.slug}`
|
||||
router.push(`/new/${org.slug}`)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +68,7 @@ const Wizard = () => {
|
||||
]}
|
||||
footer={[
|
||||
<div key="panel-footer" className="flex items-center w-full justify-between">
|
||||
<Button type="default" onClick={() => Router.push('/')}>
|
||||
<Button type="default" onClick={() => router.push('/')}>
|
||||
Cancel
|
||||
</Button>
|
||||
<div className="space-x-3">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { values } from 'mobx'
|
||||
import { Project } from 'types'
|
||||
import { Organization, Project } from 'types'
|
||||
|
||||
import { API_URL, STRIPE_PRODUCT_IDS } from 'lib/constants'
|
||||
import { IRootStore } from '../RootStore'
|
||||
@@ -71,19 +71,23 @@ export default class AppStore implements IAppStore {
|
||||
}
|
||||
}
|
||||
|
||||
onOrgUpdated(org: any) {
|
||||
if (org && org.id) {
|
||||
this.organizations.data[org.id] = { ...org }
|
||||
onOrgUpdated(updatedOrg: Organization) {
|
||||
if (updatedOrg && updatedOrg.id) {
|
||||
const originalOrg = this.organizations.data[updatedOrg.id]
|
||||
this.organizations.data[updatedOrg.id] = {
|
||||
...originalOrg,
|
||||
...updatedOrg,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onOrgAdded(org: any) {
|
||||
onOrgAdded(org: Organization) {
|
||||
if (org && org.id) {
|
||||
this.organizations.data[org.id] = { ...org }
|
||||
this.organizations.data[org.id] = org
|
||||
}
|
||||
}
|
||||
|
||||
onOrgDeleted(org: any) {
|
||||
onOrgDeleted(org: Organization) {
|
||||
if (org && org.id) {
|
||||
const projects = values(this.projects.data)
|
||||
// cleanup projects saved queries
|
||||
|
||||
@@ -4,9 +4,13 @@ export interface Organization {
|
||||
name: string
|
||||
billing_email: string
|
||||
project_limit: number
|
||||
stripe_customer_id?: string
|
||||
total_free_projects?: number
|
||||
members: any[]
|
||||
projects: any[]
|
||||
is_owner?: boolean
|
||||
stripe_customer_id?: string
|
||||
stripe_customer_object?: any
|
||||
total_free_projects?: number
|
||||
total_paid_projects?: number
|
||||
}
|
||||
|
||||
export interface Project {
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
process.env.SUPABASE_URL = 'http://localhost:8000'
|
||||
process.env.SUPABASE_KEY_ANON =
|
||||
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYyNzIwODU0MCwiZXhwIjoxOTc0MzYzNzQwfQ.zcaQfHd3VA7XgJmdGfmV86OLVJT9s2MTmSy-e69BpUY'
|
||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE'
|
||||
process.env.SUPABASE_KEY_ADMIN =
|
||||
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIiwiaWF0IjoxNjI3MjA4NTQwLCJleHAiOjE5NzQzNjM3NDB9.pkT3PNpO4DtO45Ac5HK_TKCx8sGLgNtV__pr_ZrRSAU'
|
||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJzZXJ2aWNlX3JvbGUiLAogICAgImlzcyI6ICJzdXBhYmFzZS1kZW1vIiwKICAgICJpYXQiOiAxNjQxNzY5MjAwLAogICAgImV4cCI6IDE3OTk1MzU2MDAKfQ.DaYlNEoUrrEn2Ig7tqibS-PHK5vgusbcbo7X36XVt4Q'
|
||||
@@ -716,6 +716,48 @@ pages:
|
||||
console.log(event, session)
|
||||
})
|
||||
```
|
||||
- name: Listen to sign in
|
||||
js: |
|
||||
```js
|
||||
supabase.auth.onAuthStateChange((event, session) => {
|
||||
if (event == 'SIGNED_IN') console.log('SIGNED_IN', session)
|
||||
})
|
||||
```
|
||||
- name: Listen to sign out
|
||||
js: |
|
||||
```js
|
||||
supabase.auth.onAuthStateChange((event, session) => {
|
||||
if (event == 'SIGNED_OUT') console.log('SIGNED_OUT', session)
|
||||
})
|
||||
```
|
||||
- name: Listen to token refresh
|
||||
js: |
|
||||
```js
|
||||
supabase.auth.onAuthStateChange((event, session) => {
|
||||
if (event == 'TOKEN_REFRESHED') console.log('TOKEN_REFRESHED', session)
|
||||
})
|
||||
```
|
||||
- name: Listen to user updates
|
||||
js: |
|
||||
```js
|
||||
supabase.auth.onAuthStateChange((event, session) => {
|
||||
if (event == 'USER_UPDATED') console.log('USER_UPDATED', session)
|
||||
})
|
||||
```
|
||||
- name: Listen to user deleted
|
||||
js: |
|
||||
```js
|
||||
supabase.auth.onAuthStateChange((event, session) => {
|
||||
if (event == 'USER_DELETED') console.log('USER_DELETED', session)
|
||||
})
|
||||
```
|
||||
- name: Listen to password recovery events
|
||||
js: |
|
||||
```js
|
||||
supabase.auth.onAuthStateChange((event, session) => {
|
||||
if (event == 'PASSWORD_RECOVERY') console.log('PASSWORD_RECOVERY', session)
|
||||
})
|
||||
```
|
||||
auth.api.getUser():
|
||||
title: 'getUser()'
|
||||
$ref: '@supabase/gotrue-js.GoTrueApi.getUser'
|
||||
|
||||
@@ -253,7 +253,7 @@ const Nav = (props: Props) => {
|
||||
<a href="https://app.supabase.io/">
|
||||
<Button type="default">Sign in</Button>
|
||||
</a>
|
||||
<a href="https://app.supabase.io/">
|
||||
<a href="https://app.supabase.io/new/project">
|
||||
<Button>Start your project</Button>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user