-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow minimum password strength to be configurable globally (#168)
* clean up settings * allow changing password strength requirements
- Loading branch information
Showing
18 changed files
with
163 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script lang="ts"> | ||
import type { Snippet } from "svelte"; | ||
interface Props { | ||
title: string; | ||
subtitle?: string; | ||
children: Snippet; | ||
} | ||
const { title, subtitle, children }: Props = $props(); | ||
</script> | ||
|
||
<div class="flex flex-col space-y-2"> | ||
<h2 class="h2">{title}</h2> | ||
{#if subtitle} | ||
<span>{subtitle}</span> | ||
{/if} | ||
{@render children()} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
<script lang="ts"> | ||
import BaseSetting from "./BaseSetting.svelte"; | ||
interface Props { | ||
enabled: boolean; | ||
} | ||
let { enabled = $bindable() }: Props = $props(); | ||
</script> | ||
|
||
<div class="flex flex-col space-y-2"> | ||
<h2 class="h2">Claims</h2> | ||
<BaseSetting title="Claims"> | ||
<label class="unstyled flex flex-row space-x-2"> | ||
<input id="claimsShowName" name="claimsShowName" class="checkbox" type="checkbox" bind:checked={enabled} /> | ||
<span>Show Name</span> | ||
</label> | ||
</div> | ||
</BaseSetting> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
<script lang="ts"> | ||
import BaseSetting from "./BaseSetting.svelte"; | ||
interface Props { | ||
enabled: boolean; | ||
} | ||
let { enabled = $bindable() }: Props = $props(); | ||
</script> | ||
|
||
<div class="flex flex-col space-y-2"> | ||
<h2 class="h2">Public Signup</h2> | ||
<BaseSetting title="Public Signup"> | ||
<label class="unstyled flex flex-row space-x-2"> | ||
<input id="enableSignup" name="enableSignup" class="checkbox" type="checkbox" bind:checked={enabled} /> | ||
<span>Enable</span> | ||
</label> | ||
</div> | ||
</BaseSetting> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script lang="ts"> | ||
import BaseSetting from "./BaseSetting.svelte"; | ||
interface Props { | ||
passwordStrength: number; | ||
} | ||
import { strengthOptions } from "$lib/zxcvbn"; | ||
let { passwordStrength = $bindable() }: Props = $props(); | ||
</script> | ||
|
||
<BaseSetting title="Security"> | ||
<label class="flex flex-col" for="passwordStrength"> | ||
<span>Password Strength Requirement</span> | ||
<select id="passwordStrength" name="passwordStrength" class="select w-full" bind:value={passwordStrength}> | ||
{#each strengthOptions as label, idx} | ||
<option value={idx - 1}>{label}</option> | ||
{/each} | ||
</select> | ||
<div class="flex flex-row items-center space-x-2"> | ||
<iconify-icon icon="ion:information-circle-outline"></iconify-icon> | ||
<span class="font-bold"> | ||
Use caution when changing or disabling this value! If disabled, any password of 1 character or more will | ||
be allowed. | ||
</span> | ||
</div> | ||
</label> | ||
</BaseSetting> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.