feat(auth): implement TOTP setup and management
Lint / Lint (Node/Svelte) (push) Successful in 24s
Lint / Lint (Go) (push) Successful in 28s
Lint / Lint (Python) (push) Failing after 14s
Tests / Test (Node/Svelte) (push) Successful in 18s
Tests / Test (Go) (push) Successful in 25s
Tests / Test (Python) (push) Successful in 12s

- Added TOTP support for two-factor authentication in the auth module.
- Introduced new types and interfaces for TOTP setup and token actions in the web UI.
- Created backend logic for generating and verifying TOTP secrets and tokens.
- Implemented user management features including role assignments and user CRUD operations.
- Enhanced UI components for managing users and TOTP settings.
- Added styles for optional labels and authentication reset links.
- Implemented reset code generation and validation for admin accounts.
This commit is contained in:
Gabriel20xx committed 2026-08-05 14:57:01 +02:00
1 parent 2f57554154
commit da97fd4fb1
30 files changed
+2145 -27

No files matched your search

+199
View File
@@ -330,6 +330,71 @@
font-weight: 650;
}
.sc-label-optional {
color: var(--sc-muted-fg);
font-weight: 400;
}
.sc-totp-settings {
display: grid;
gap: 0.75rem;
margin-top: 1.5rem;
padding-top: 1.25rem;
border-top: 1px solid var(--sc-border);
}
.sc-totp-heading {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 1rem;
}
.sc-totp-heading h3 {
margin: 0;
font-size: 0.95rem;
}
.sc-totp-heading p {
margin: 0.25rem 0 0;
}
.sc-totp-status {
flex: 0 0 auto;
border: 1px solid var(--sc-border);
border-radius: 999px;
padding: 0.2rem 0.55rem;
color: var(--sc-muted-fg);
font-size: 0.75rem;
font-weight: 600;
}
.sc-totp-status.sc-totp-enabled {
border-color: var(--sc-success);
color: var(--sc-success);
}
.sc-totp-secret {
display: grid;
gap: 0.5rem;
color: var(--sc-muted-fg);
font-size: 0.8rem;
overflow-wrap: anywhere;
}
.sc-totp-secret p {
margin: 0;
}
.sc-totp-secret code {
display: block;
border-radius: 0.4rem;
background: var(--sc-input-bg);
padding: 0.6rem;
color: var(--sc-fg);
font-size: 0.7rem;
}
.sc-input,
.sc-select,
.sc-textarea {
@@ -383,6 +448,109 @@
color: var(--sc-success);
}
.sc-user-management {
display: grid;
gap: 1rem;
margin-top: 1.5rem;
padding-top: 1.5rem;
border-top: 1px solid var(--sc-border);
}
.sc-user-management-header,
.sc-user-row,
.sc-user-edit-row {
display: flex;
align-items: center;
gap: 0.75rem;
}
.sc-user-management-header {
justify-content: space-between;
}
.sc-user-management-header h3 {
margin: 0;
}
.sc-user-management-header p {
margin: 0.25rem 0 0;
}
.sc-user-form,
.sc-user-list {
display: grid;
gap: 0.75rem;
}
.sc-user-form {
padding: 0.9rem;
border: 1px solid var(--sc-border);
border-radius: 0.6rem;
background: var(--sc-surface-raised);
}
.sc-user-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0.6rem;
}
.sc-user-row {
min-width: 0;
justify-content: space-between;
padding: 0.7rem 0;
border-bottom: 1px solid var(--sc-border);
}
.sc-user-row > div:first-child {
display: grid;
min-width: 0;
}
.sc-user-row > div:first-child span {
overflow: hidden;
color: var(--sc-muted-fg);
text-overflow: ellipsis;
white-space: nowrap;
}
.sc-user-role {
color: var(--sc-muted-fg);
font-size: 0.8rem;
text-transform: capitalize;
}
.sc-user-actions {
display: flex;
flex-shrink: 0;
gap: 0.4rem;
}
.sc-user-edit-row {
align-items: stretch;
flex-wrap: wrap;
}
.sc-user-edit-row .sc-input {
flex: 1 1 10rem;
min-width: 8rem;
}
@media (max-width: 620px) {
.sc-user-grid {
grid-template-columns: 1fr;
}
.sc-user-row {
align-items: flex-start;
flex-wrap: wrap;
}
.sc-user-actions {
width: 100%;
}
}
.sc-auth-page {
display: grid;
min-height: 100vh;
@@ -423,6 +591,37 @@
margin-top: 1rem;
}
.sc-auth-reset {
display: grid;
gap: 0.625rem;
margin-top: 1.25rem;
padding-top: 1rem;
border-top: 1px solid var(--sc-border);
}
.sc-auth-reset-hint {
color: var(--sc-subtle-fg);
font-size: 0.75rem;
line-height: 1.45;
}
.sc-auth-reset-link {
display: block;
margin: 1.25rem auto 0;
padding: 0;
color: var(--sc-subtle-fg);
font: inherit;
font-size: 0.75rem;
text-decoration: underline;
background: none;
border: 0;
cursor: pointer;
}
.sc-auth-reset-link:hover {
color: var(--sc-fg);
}
.sc-dialog-backdrop {
position: fixed;
z-index: 100;