mirror of
https://github.com/nikdoof/pocket-id.git
synced 2025-12-23 22:39:24 +00:00
refactor: run formatter
This commit is contained in:
@@ -100,14 +100,14 @@
|
||||
{:else}
|
||||
<SignInWrapper showEmailOneTimeAccessButton={$appConfigStore.emailOneTimeAccessEnabled}>
|
||||
<ClientProviderImages {client} {success} error={!!errorMessage} />
|
||||
<h1 class="font-playfair mt-5 text-3xl font-bold sm:text-4xl">Sign in to {client.name}</h1>
|
||||
<h1 class="mt-5 font-playfair text-3xl font-bold sm:text-4xl">Sign in to {client.name}</h1>
|
||||
{#if errorMessage}
|
||||
<p class="text-muted-foreground mb-10 mt-2">
|
||||
<p class="mb-10 mt-2 text-muted-foreground">
|
||||
{errorMessage}. Please try again.
|
||||
</p>
|
||||
{/if}
|
||||
{#if !authorizationRequired && !errorMessage}
|
||||
<p class="text-muted-foreground mb-10 mt-2">
|
||||
<p class="mb-10 mt-2 text-muted-foreground">
|
||||
Do you want to sign in to <b>{client.name}</b> with your
|
||||
<b>{$appConfigStore.appName}</b> account?
|
||||
</p>
|
||||
@@ -115,7 +115,7 @@
|
||||
<div transition:slide={{ duration: 300 }}>
|
||||
<Card.Root class="mb-10 mt-6">
|
||||
<Card.Header class="pb-5">
|
||||
<p class="text-muted-foreground text-start">
|
||||
<p class="text-start text-muted-foreground">
|
||||
<b>{client.name}</b> wants to access the following information:
|
||||
</p>
|
||||
</Card.Header>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<div class="flex justify-center gap-3">
|
||||
<div
|
||||
class=" bg-muted rounded-2xl p-3 transition-transform duration-500 ease-in {success || error
|
||||
class=" rounded-2xl bg-muted p-3 transition-transform duration-500 ease-in {success || error
|
||||
? 'translate-x-[108px]'
|
||||
: ''}"
|
||||
>
|
||||
|
||||
@@ -39,15 +39,15 @@
|
||||
<div class="flex justify-center">
|
||||
<LoginLogoErrorSuccessIndicator error={!!error} />
|
||||
</div>
|
||||
<h1 class="font-playfair mt-5 text-3xl font-bold sm:text-4xl">
|
||||
<h1 class="mt-5 font-playfair text-3xl font-bold sm:text-4xl">
|
||||
Sign in to {$appConfigStore.appName}
|
||||
</h1>
|
||||
{#if error}
|
||||
<p class="text-muted-foreground mt-2" in:fade>
|
||||
<p class="mt-2 text-muted-foreground" in:fade>
|
||||
{error}. Please try to sign in again.
|
||||
</p>
|
||||
{:else}
|
||||
<p class="text-muted-foreground mt-2" in:fade>
|
||||
<p class="mt-2 text-muted-foreground" in:fade>
|
||||
Authenticate yourself with your passkey to access the admin panel.
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
@@ -45,15 +45,15 @@
|
||||
<div class="flex justify-center">
|
||||
<LoginLogoErrorSuccessIndicator error={!!error} />
|
||||
</div>
|
||||
<h1 class="font-playfair mt-5 text-4xl font-bold">
|
||||
<h1 class="mt-5 font-playfair text-4xl font-bold">
|
||||
{data.token === 'setup' ? `${$appConfigStore.appName} Setup` : 'One Time Access'}
|
||||
</h1>
|
||||
{#if error}
|
||||
<p class="text-muted-foreground mt-2">
|
||||
<p class="mt-2 text-muted-foreground">
|
||||
{error}. Please try again.
|
||||
</p>
|
||||
{:else if !skipPage}
|
||||
<p class="text-muted-foreground mt-2">
|
||||
<p class="mt-2 text-muted-foreground">
|
||||
{#if data.token === 'setup'}
|
||||
You're about to sign in to the initial admin account. Anyone with this link can access the
|
||||
account until a passkey is added. Please set up a passkey as soon as possible to prevent
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
<div class="flex justify-center">
|
||||
<LoginLogoErrorSuccessIndicator {success} error={!!error} />
|
||||
</div>
|
||||
<h1 class="font-playfair mt-5 text-3xl font-bold sm:text-4xl">Email One Time Access</h1>
|
||||
<h1 class="mt-5 font-playfair text-3xl font-bold sm:text-4xl">Email One Time Access</h1>
|
||||
{#if error}
|
||||
<p class="text-muted-foreground mt-2" in:fade>
|
||||
<p class="mt-2 text-muted-foreground" in:fade>
|
||||
{error}. Please try again.
|
||||
</p>
|
||||
<div class="mt-10 flex w-full justify-stretch gap-2">
|
||||
@@ -44,12 +44,12 @@
|
||||
<Button class="w-full" onclick={() => (error = undefined)}>Try again</Button>
|
||||
</div>
|
||||
{:else if success}
|
||||
<p class="text-muted-foreground mt-2" in:fade>
|
||||
<p class="mt-2 text-muted-foreground" in:fade>
|
||||
An email has been sent to the provided email, if it exists in the system.
|
||||
</p>
|
||||
{:else}
|
||||
<form onsubmit={requestEmail}>
|
||||
<p class="text-muted-foreground mt-2" in:fade>
|
||||
<p class="mt-2 text-muted-foreground" in:fade>
|
||||
Enter your email to receive an email with a one time access link.
|
||||
</p>
|
||||
<Input id="Email" class="mt-7" placeholder="Your email" bind:value={email} />
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
</script>
|
||||
|
||||
<section>
|
||||
<div class="bg-muted/40 flex min-h-[calc(100vh-64px)] w-full flex-col justify-between">
|
||||
<div class="flex min-h-[calc(100vh-64px)] w-full flex-col justify-between bg-muted/40">
|
||||
<main
|
||||
class="mx-auto flex w-full max-w-[1640px] flex-col gap-x-4 gap-y-10 p-4 md:p-10 lg:flex-row"
|
||||
>
|
||||
@@ -44,9 +44,9 @@
|
||||
<div
|
||||
class="mx-auto grid items-start gap-6 md:grid-cols-[180px_1fr] lg:grid-cols-[250px_1fr]"
|
||||
>
|
||||
<nav class="text-muted-foreground grid gap-4 text-sm">
|
||||
<nav class="grid gap-4 text-sm text-muted-foreground">
|
||||
{#each links as { href, label }}
|
||||
<a {href} class={$page.url.pathname.startsWith(href) ? 'text-primary font-bold' : ''}>
|
||||
<a {href} class={$page.url.pathname.startsWith(href) ? 'font-bold text-primary' : ''}>
|
||||
{label}
|
||||
</a>
|
||||
{/each}
|
||||
@@ -67,7 +67,7 @@
|
||||
</div>
|
||||
</main>
|
||||
<div class="flex flex-col items-center">
|
||||
<p class="text-muted-foreground py-3 text-xs">
|
||||
<p class="py-3 text-xs text-muted-foreground">
|
||||
Powered by <a
|
||||
class="text-foreground"
|
||||
href="https://github.com/stonith404/pocket-id"
|
||||
|
||||
@@ -2,4 +2,4 @@ import { redirect } from '@sveltejs/kit';
|
||||
|
||||
export function load() {
|
||||
throw redirect(307, '/settings/account');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,14 +21,14 @@
|
||||
appName: appConfig.appName,
|
||||
sessionDuration: appConfig.sessionDuration,
|
||||
emailsVerified: appConfig.emailsVerified,
|
||||
allowOwnAccountEdit: appConfig.allowOwnAccountEdit,
|
||||
allowOwnAccountEdit: appConfig.allowOwnAccountEdit
|
||||
};
|
||||
|
||||
const formSchema = z.object({
|
||||
appName: z.string().min(2).max(30),
|
||||
sessionDuration: z.number().min(1).max(43200),
|
||||
emailsVerified: z.boolean(),
|
||||
allowOwnAccountEdit: z.boolean(),
|
||||
allowOwnAccountEdit: z.boolean()
|
||||
});
|
||||
|
||||
const { inputs, ...form } = createForm<typeof formSchema>(formSchema, updatedAppConfig);
|
||||
@@ -61,7 +61,7 @@
|
||||
label="Emails Verified"
|
||||
description="Whether the user's email should be marked as verified for the OIDC clients."
|
||||
bind:checked={$inputs.emailsVerified.value}
|
||||
/>
|
||||
/>
|
||||
</div>
|
||||
<div class="mt-5 flex justify-end">
|
||||
<Button {isLoading} type="submit">Save</Button>
|
||||
|
||||
@@ -82,14 +82,13 @@
|
||||
|
||||
async function syncLdap() {
|
||||
ldapSyncing = true;
|
||||
await appConfigService.syncLdap()
|
||||
.then(()=> toast.success('LDAP sync finished'))
|
||||
.catch(axiosErrorToast);
|
||||
await appConfigService
|
||||
.syncLdap()
|
||||
.then(() => toast.success('LDAP sync finished'))
|
||||
.catch(axiosErrorToast);
|
||||
|
||||
ldapSyncing = false;
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<form onsubmit={onSubmit}>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
</svelte:head>
|
||||
|
||||
<div>
|
||||
<a class="text-muted-foreground flex text-sm" href="/settings/admin/oidc-clients"
|
||||
<a class="flex text-sm text-muted-foreground" href="/settings/admin/oidc-clients"
|
||||
><LucideChevronLeft class="h-5 w-5" /> Back</a
|
||||
>
|
||||
</div>
|
||||
@@ -97,7 +97,7 @@
|
||||
<div class="mb-2 flex">
|
||||
<Label class="mb-0 w-44">Client ID</Label>
|
||||
<CopyToClipboard value={client.id}>
|
||||
<span class="text-muted-foreground text-sm" data-testid="client-id"> {client.id}</span>
|
||||
<span class="text-sm text-muted-foreground" data-testid="client-id"> {client.id}</span>
|
||||
</CopyToClipboard>
|
||||
</div>
|
||||
{#if !client.isPublic}
|
||||
@@ -105,12 +105,12 @@
|
||||
<Label class="w-44">Client secret</Label>
|
||||
{#if $clientSecretStore}
|
||||
<CopyToClipboard value={$clientSecretStore}>
|
||||
<span class="text-muted-foreground text-sm" data-testid="client-secret">
|
||||
<span class="text-sm text-muted-foreground" data-testid="client-secret">
|
||||
{$clientSecretStore}
|
||||
</span>
|
||||
</CopyToClipboard>
|
||||
{:else}
|
||||
<span class="text-muted-foreground text-sm" data-testid="client-secret"
|
||||
<span class="text-sm text-muted-foreground" data-testid="client-secret"
|
||||
>••••••••••••••••••••••••••••••••</span
|
||||
>
|
||||
<Button
|
||||
@@ -129,7 +129,7 @@
|
||||
<div class="mb-5 flex">
|
||||
<Label class="mb-0 w-44">{key}</Label>
|
||||
<CopyToClipboard {value}>
|
||||
<span class="text-muted-foreground text-sm">{value}</span>
|
||||
<span class="text-sm text-muted-foreground">{value}</span>
|
||||
</CopyToClipboard>
|
||||
</div>
|
||||
{/each}
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
id="pkce"
|
||||
label="PKCE"
|
||||
description="Public Key Code Exchange is a security feature to prevent CSRF and authorization code interception attacks."
|
||||
disabled={$inputs.isPublic.value}
|
||||
disabled={$inputs.isPublic.value}
|
||||
bind:checked={$inputs.pkceEnabled.value}
|
||||
/>
|
||||
</div>
|
||||
@@ -104,7 +104,7 @@
|
||||
<Label for="logo">Logo</Label>
|
||||
<div class="mt-2 flex items-end gap-3">
|
||||
{#if logoDataURL}
|
||||
<div class="bg-muted h-32 w-32 rounded-2xl p-3">
|
||||
<div class="h-32 w-32 rounded-2xl bg-muted p-3">
|
||||
<img
|
||||
class="m-auto max-h-full max-w-full object-contain"
|
||||
src={logoDataURL}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<AdvancedTable
|
||||
items={clients}
|
||||
{requestOptions}
|
||||
onRefresh={async(o) => clients = await oidcService.listClients(o)}
|
||||
onRefresh={async (o) => (clients = await oidcService.listClients(o))}
|
||||
columns={[
|
||||
{ label: 'Logo' },
|
||||
{ label: 'Name', sortColumn: 'name' },
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
</svelte:head>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<a class="text-muted-foreground flex text-sm" href="/settings/admin/user-groups"
|
||||
<a class="flex text-sm text-muted-foreground" href="/settings/admin/user-groups"
|
||||
><LucideChevronLeft class="h-5 w-5" /> Back</a
|
||||
>
|
||||
{#if !!userGroup.ldapId}
|
||||
@@ -92,9 +92,8 @@
|
||||
/>
|
||||
{/await}
|
||||
<div class="mt-5 flex justify-end">
|
||||
<Button
|
||||
disabled={!!userGroup.ldapId}
|
||||
on:click={() => updateUserGroupUsers(userGroup.userIds)}>Save</Button
|
||||
<Button disabled={!!userGroup.ldapId} on:click={() => updateUserGroupUsers(userGroup.userIds)}
|
||||
>Save</Button
|
||||
>
|
||||
</div>
|
||||
</Card.Content>
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
users: initialUsers,
|
||||
selectionDisabled = false,
|
||||
selectedUserIds = $bindable()
|
||||
}: { users: Paginated<User>;
|
||||
selectionDisabled?: boolean;
|
||||
selectedUserIds: string[] } = $props();
|
||||
}: { users: Paginated<User>; selectionDisabled?: boolean; selectedUserIds: string[] } = $props();
|
||||
|
||||
const userService = new UserService();
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</svelte:head>
|
||||
|
||||
<div class="flex items-center justify-between">
|
||||
<a class="text-muted-foreground flex text-sm" href="/settings/admin/users"
|
||||
<a class="flex text-sm text-muted-foreground" href="/settings/admin/users"
|
||||
><LucideChevronLeft class="h-5 w-5" /> Back</a
|
||||
>
|
||||
{#if !!user.ldapId}
|
||||
|
||||
@@ -75,10 +75,7 @@
|
||||
</Select.Content>
|
||||
</Select.Root>
|
||||
</div>
|
||||
<Button
|
||||
onclick={() => createOneTimeAccessToken()}
|
||||
disabled={!selectedExpiration}
|
||||
>
|
||||
<Button onclick={() => createOneTimeAccessToken()} disabled={!selectedExpiration}>
|
||||
Generate Link
|
||||
</Button>
|
||||
{:else}
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
<Card.Root>
|
||||
<Card.Header>
|
||||
<Card.Title>Audit Log</Card.Title>
|
||||
<Card.Description class="mt-1">See your account activities from the last 3 months.</Card.Description>
|
||||
<Card.Description class="mt-1"
|
||||
>See your account activities from the last 3 months.</Card.Description
|
||||
>
|
||||
</Card.Header>
|
||||
<Card.Content>
|
||||
<AuditLogList auditLogs={data.auditLogs} />
|
||||
|
||||
Reference in New Issue
Block a user