mirror of
https://github.com/Since-3/since3-portal.git
synced 2026-10-12 21:41:16 +00:00
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import { verifySession } from "@/lib/supabase/dal"
|
|
import { createAdminClient } from "@/lib/supabase/admin"
|
|
import { getCredentials } from "@/modules/shared/queries/credentials"
|
|
import { CredentialsTable } from "@/modules/shared/ui/components/credentials-table"
|
|
import { CredentialDialog } from "@/modules/shared/ui/components/credential-dialog"
|
|
|
|
const PasswordClientViewPage = async () => {
|
|
const session = await verifySession()
|
|
|
|
const supabase = createAdminClient()
|
|
const { data: profile } = await supabase
|
|
.from("profiles")
|
|
.select("client_id")
|
|
.eq("id", session.userId)
|
|
.single()
|
|
|
|
const credentials = profile?.client_id ? await getCredentials(profile.client_id) : []
|
|
|
|
return (
|
|
<div className="flex flex-col gap-8 w-full">
|
|
<div className="w-full flex flex-row justify-between items-center">
|
|
<h1 className="text-3xl font-semibold">Passwörter</h1>
|
|
<CredentialDialog profileId={session.userId} />
|
|
</div>
|
|
<CredentialsTable profileId={session.userId} credentials={credentials} isAdmin={false} />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default PasswordClientViewPage
|