Skip to content

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

Scaffold showing authorized apps

Joshen Lim07200f2e1a34
diff --git a/studio/components/interfaces/Organization/OAuthApps/AuthorizeRequesterDetails.tsx b/studio/components/interfaces/Organization/OAuthApps/AuthorizeRequesterDetails.tsx
index 96c760ace05..16d4edac3f7 100644
--- a/studio/components/interfaces/Organization/OAuthApps/AuthorizeRequesterDetails.tsx
+++ b/studio/components/interfaces/Organization/OAuthApps/AuthorizeRequesterDetails.tsx
@@ -8,9 +8,9 @@ const AuthorizeRequesterDetails = ({ icon, name, domain }: AuthorizeRequesterDet
return (
<div className="flex space-x-4">
<div>
- <div className="rounded-md border border-scale-600 flex items-center">
+ <div className="flex items-center">
<div
- className="w-14 h-14 md:w-16 md:h-16 bg-center bg-no-repeat bg-cover flex items-center justify-center"
+ className="w-14 h-14 md:w-16 md:h-16 bg-center bg-no-repeat bg-cover flex items-center justify-center rounded-md border border-scale-600"
style={{
backgroundImage: icon !== null ? `url('${icon}')` : 'none',
}}
diff --git a/studio/components/interfaces/Organization/OAuthApps/OAuthApps.tsx b/studio/components/interfaces/Organization/OAuthApps/OAuthApps.tsx
index d286accbdcb..1e1cda4a0c4 100644
--- a/studio/components/interfaces/Organization/OAuthApps/OAuthApps.tsx
+++ b/studio/components/interfaces/Organization/OAuthApps/OAuthApps.tsx
@@ -20,9 +20,9 @@ const OAuthApps = () => {
const {
data: publishedApps,
- isLoading,
- isSuccess,
- isError,
+ isLoading: isLoadingPublishedApps,
+ isSuccess: isSuccessPublishedApps,
+ isError: isErrorPublishedApps,
} = useOAuthAppsQuery({
slug,
type: 'published',
@@ -32,6 +32,20 @@ const OAuthApps = () => {
return Number(new Date(a.created_at)) - Number(new Date(b.created_at))
})
+ const {
+ data: authorizedApps,
+ isLoading: isLoadingAuthorizedApps,
+ isSuccess: isSuccessAuthorizedApps,
+ isError: isErrorAuthorizedApps,
+ } = useOAuthAppsQuery({
+ slug,
+ type: 'authorized',
+ })
+
+ const sortedAuthorizedApps = authorizedApps?.sort((a, b) => {
+ return Number(new Date(a.created_at)) - Number(new Date(b.created_at))
+ })
+
return (
<>
<div className="container my-4 max-w-4xl space-y-8">
@@ -49,7 +63,7 @@ const OAuthApps = () => {
</div>
<div className="mt-4">
- {isLoading && (
+ {isLoadingPublishedApps && (
<div className="space-y-2">
<ShimmeringLoader />
<ShimmeringLoader className="w-3/4" />
@@ -57,7 +71,9 @@ const OAuthApps = () => {
</div>
)}
- {isError && <AlertError subject="Unable to retrieve published OAuth apps" />}
+ {isErrorPublishedApps && (
+ <AlertError subject="Unable to retrieve published OAuth apps" />
+ )}
{createdApp !== undefined && (
<Alert withIcon variant="success" title="Successfully published a new application!">
@@ -100,7 +116,7 @@ const OAuthApps = () => {
</Alert>
)}
- {isSuccess && (
+ {isSuccessPublishedApps && (
<>
{(publishedApps?.length ?? 0) === 0 ? (
<div className="bg-scale-100 dark:bg-scale-300 border rounded p-4 flex items-center justify-between">
@@ -136,38 +152,36 @@ const OAuthApps = () => {
</div>
</div>
- {/* <div>
+ <div>
<p>Authorized Apps</p>
<p className="text-scale-1000 text-sm">
Applications that have access to your organization's settings and projects
</p>
<div className="mt-4">
- {(authorizedApps?.length ?? 0) === 0 ? (
- <div className="bg-scale-100 dark:bg-scale-300 border rounded p-4 flex items-center justify-between">
- <p className="prose text-sm">You do not have any authorized applications yet</p>
+ {isLoadingAuthorizedApps && (
+ <div className="space-y-2">
+ <ShimmeringLoader />
+ <ShimmeringLoader className="w-3/4" />
+ <ShimmeringLoader className="w-1/2" />
</div>
- ) : (
- <Table
- className="mt-4"
- head={[
- <Table.th key="name">Name</Table.th>,
- <Table.th key="clientId">Client ID</Table.th>,
- <Table.th key="clientSecret">Client Secret</Table.th>,
- ]}
- body={
- publishedApps?.map((app) => (
- <Table.tr key={app.id}>
- <Table.td>{app.name}</Table.td>
- <Table.td>{app.name}</Table.td>
- <Table.td>{app.name}</Table.td>
- </Table.tr>
- )) ?? []
- }
- />
+ )}
+
+ {isErrorAuthorizedApps && <AlertError subject="Unable to retrieve authorized apps" />}
+
+ {isSuccessAuthorizedApps && (
+ <>
+ {(authorizedApps.length ?? 0) === 0 ? (
+ <div className="bg-scale-100 dark:bg-scale-300 border rounded p-4 flex items-center justify-between">
+ <p className="prose text-sm">You do not have any authorized applications yet</p>
+ </div>
+ ) : (
+ <div></div>
+ )}
+ </>
)}
</div>
- </div> */}
+ </div>
</div>
<PublishAppModal