Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: api.getUser return type

Alaister Younga23ed5fdbabc
diff --git a/i18n/README.tr.md b/i18n/README.tr.md
index 8a524307d51..662913b189a 100644
--- a/i18n/README.tr.md
+++ b/i18n/README.tr.md
@@ -186,4 +186,3 @@ Müşteri kitaplığımız modülerdir. Her bir alt kütüphane, tek bir harici
## Sponsorlar
[![New Sponsor](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase)
-
diff --git a/studio/components/layouts/AccountLayout/WithSidebar.tsx b/studio/components/layouts/AccountLayout/WithSidebar.tsx
index 4b30bd47054..b6d3b9bf74a 100644
--- a/studio/components/layouts/AccountLayout/WithSidebar.tsx
+++ b/studio/components/layouts/AccountLayout/WithSidebar.tsx
@@ -86,8 +86,8 @@ const WithSidebar: FC<Props> = ({
export default WithSidebar
const LinksWithHeaders: FC<any> = ({ links, subitems, subitemsParentKey }) => {
- return links.map((x: any) => (
- <div key={x.heading} className="dark:border-dark border-b py-5 px-6">
+ return links.map((x: any, i: number) => (
+ <div key={x.heading || `${i}`} className="dark:border-dark border-b py-5 px-6">
{x.heading && <Menu.Group title={x.heading} />}
{x.versionLabel && (
<div className="mb-1 px-3">
diff --git a/studio/hooks/misc/withAuth.tsx b/studio/hooks/misc/withAuth.tsx
index 6ed9a74c474..4709c2972f3 100644
--- a/studio/hooks/misc/withAuth.tsx
+++ b/studio/hooks/misc/withAuth.tsx
@@ -40,10 +40,10 @@ export function withAuth<T>(
} else if (returning !== 'minimal') {
ui.setProfile(profile)
- if (!app.organizations.isInitialized) {
+ if (!app.organizations.isInitialized && !app.organizations.isLoading) {
app.organizations.load()
}
- if (!app.projects.isInitialized) {
+ if (!app.projects.isInitialized && !app.projects.isLoading) {
app.projects.load()
}
}
diff --git a/studio/lib/gotrue.ts b/studio/lib/gotrue.ts
index de73677ac57..358b7cb326e 100644
--- a/studio/lib/gotrue.ts
+++ b/studio/lib/gotrue.ts
@@ -10,7 +10,7 @@ export const auth = new GoTrueClient({
export const getAuthUser = async (token: String): Promise<any> => {
try {
- const { data: user, error } = await auth.api.getUser(token.replace('Bearer ', ''))
+ const { user, error } = await auth.api.getUser(token.replace('Bearer ', ''))
if (error) throw error
return { user, error: null }