Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3e32f239d | ||
|
|
878ac92948 |
No files matched your search
@@ -43,10 +43,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
uses: docker/login-action@v4
|
uses: nick-fields/retry@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
timeout_minutes: 5
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
max_attempts: 3
|
||||||
|
retry_wait_seconds: 15
|
||||||
|
command: |
|
||||||
|
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ vars.DOCKERHUB_USERNAME }}" --password-stdin
|
||||||
|
|
||||||
- name: Extract Docker metadata
|
- name: Extract Docker metadata
|
||||||
id: meta
|
id: meta
|
||||||
|
|||||||
@@ -201,7 +201,6 @@
|
|||||||
class="sc-input"
|
class="sc-input"
|
||||||
minlength="8"
|
minlength="8"
|
||||||
name="password"
|
name="password"
|
||||||
required
|
|
||||||
type="password"
|
type="password"
|
||||||
bind:value={password}
|
bind:value={password}
|
||||||
/>
|
/>
|
||||||
@@ -229,7 +228,6 @@
|
|||||||
class="sc-input"
|
class="sc-input"
|
||||||
minlength="8"
|
minlength="8"
|
||||||
name="confirmPassword"
|
name="confirmPassword"
|
||||||
required
|
|
||||||
type="password"
|
type="password"
|
||||||
bind:value={confirmPassword}
|
bind:value={confirmPassword}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -72,6 +72,10 @@
|
|||||||
async function createUser(event: SubmitEvent): Promise<void> {
|
async function createUser(event: SubmitEvent): Promise<void> {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (!onCreate) return;
|
if (!onCreate) return;
|
||||||
|
if (!newUser.username.trim() && !newUser.email.trim()) {
|
||||||
|
error = 'A username or email is required.';
|
||||||
|
return;
|
||||||
|
}
|
||||||
saving = true;
|
saving = true;
|
||||||
error = '';
|
error = '';
|
||||||
notice = '';
|
notice = '';
|
||||||
@@ -152,9 +156,9 @@
|
|||||||
<form class="sc-user-form" onsubmit={createUser}>
|
<form class="sc-user-form" onsubmit={createUser}>
|
||||||
<strong>Add user</strong>
|
<strong>Add user</strong>
|
||||||
<div class="sc-user-grid">
|
<div class="sc-user-grid">
|
||||||
<input aria-label="New username" class="sc-input" placeholder="Username" required type="text" bind:value={newUser.username} />
|
<input aria-label="New username" class="sc-input" placeholder="Username (optional if email is set)" type="text" bind:value={newUser.username} />
|
||||||
<input aria-label="New email" class="sc-input" placeholder="Email" required type="email" bind:value={newUser.email} />
|
<input aria-label="New email" class="sc-input" placeholder="Email (optional if username is set)" type="email" bind:value={newUser.email} />
|
||||||
<input aria-label="New password" class="sc-input" minlength="8" placeholder="Password" required type="password" bind:value={newUser.password} />
|
<input aria-label="New password" class="sc-input" minlength="8" placeholder="Password (optional)" type="password" bind:value={newUser.password} />
|
||||||
<select aria-label="New role" class="sc-input" disabled={!canAssignAdmin} bind:value={newUser.role}>
|
<select aria-label="New role" class="sc-input" disabled={!canAssignAdmin} bind:value={newUser.role}>
|
||||||
<option value="user">User</option>
|
<option value="user">User</option>
|
||||||
{#if canAssignAdmin}<option value="admin">Admin</option>{/if}
|
{#if canAssignAdmin}<option value="admin">Admin</option>{/if}
|
||||||
|
|||||||
@@ -60,6 +60,13 @@ export interface ManagedUser {
|
|||||||
lastLoginAt?: string | null;
|
lastLoginAt?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* username/email are plain (never undefined) so <input> bindings stay simple
|
||||||
|
* -- an empty string, not an absent key, is how this form represents "not
|
||||||
|
* provided". At least one of username/email must be non-empty, and password
|
||||||
|
* may be left empty entirely; AuthGuard's POST /api/admin/users derives
|
||||||
|
* whichever of username/password is omitted (see its handleCreateUser).
|
||||||
|
*/
|
||||||
export interface UserCreateInput {
|
export interface UserCreateInput {
|
||||||
username: string;
|
username: string;
|
||||||
email: string;
|
email: string;
|
||||||
|
|||||||
Reference in new issue
Block a user