The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
feat: reduce profile information requests, faster page renders (#39729)
Stojan Dimitrovski153987462c75
diff --git a/apps/studio/data/profile/profile-identities-query.ts b/apps/studio/data/profile/profile-identities-query.tsindex e640502c83b..15482f0536e 100644--- a/apps/studio/data/profile/profile-identities-query.ts+++ b/apps/studio/data/profile/profile-identities-query.ts@@ -5,11 +5,16 @@ import { auth } from 'lib/gotrue'import { profileKeys } from './keys'export async function getProfileIdentities() {- const { error, data } = await auth.getUser()+ // getSession() uses a cached user object, which is almost never stale as the+ // session refresh logic keeps it fresh. If there are claims of data not being+ // fresh, it's because it was modified on another device / browser and the+ // session hasn't been refreshed yet.+ const { error, data } = await auth.getSession()if (error) throw error+ if (!data.session) throw new Error('Session not found with getSession()')- const { identities = [], new_email, email_change_sent_at } = data.user+ const { identities = [], new_email, email_change_sent_at } = data.session.userreturn { identities, new_email, email_change_sent_at }}