feat: totp 2fa; httpcontext extension for jwtuser; asp.net data protection; prevent banned users from certain actions; account deletion requires 2fa if enabled; making users admins requires 2fa if enabled; httpcontext extension to get ip; enhance user store

refactor: organize dtos by domain; verification providers use verification context; move ip parsing into http context extensions
chore: clean code
This commit is contained in:
2026-01-07 16:36:41 -05:00
parent 361cf76f46
commit 20ceb91db8
46 changed files with 1568 additions and 162 deletions
+15 -2
View File
@@ -82,7 +82,11 @@
}
window.location.href = `/${result.id}`;
} else {
error = 'Failed to create paste. Please try again.';
if (response.status === 403) {
error = 'You are banned from creating new pastes.';
} else {
error = 'Failed to create paste. Please try again.';
}
setInterval(() => {
error = '';
}, 5000);
@@ -152,7 +156,8 @@
{/if}
<button
type="submit"
class="w-full cursor-pointer rounded bg-neutral-700 px-4 py-2 font-semibold text-white transition-colors duration-200 hover:bg-neutral-800 active:bg-neutral-900"
disabled={$user?.roles && $user.roles.includes(403)}
class="w-full cursor-pointer rounded bg-neutral-700 px-4 py-2 font-semibold text-white transition-colors duration-200 hover:bg-neutral-800 active:bg-neutral-900 disabled:cursor-not-allowed disabled:bg-neutral-950/50 disabled:text-neutral-400"
>Create Paste</button
>
{#if error}
@@ -163,6 +168,14 @@
{error}
</div>
{/if}
{#if $user?.roles && $user.roles.includes(403)}
<div
transition:fly={{ y: 40, duration: 300 }}
class="mt-2 rounded border border-red-900 bg-red-950 p-2 text-sm text-red-200"
>
You are banned from creating new pastes.
</div>
{/if}
</form>
</div>
</main>