Use email as host login credential; remove separate username field; v2.0.8
Publish Container / docker (push) Failing after 10m44s
Publish Container / docker (push) Failing after 10m44s
- Login form now asks for email + password (no username) - Admin creates hosts with name + email + password; email is always required and welcome email always sends on creation - Duplicate email check replaces duplicate username check - Admin table shows Email (login) column only; username field removed throughout data model, routes, and UI Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
a12a471c41
commit
684181c34c
5 files changed
+33
-46
No files matched your search
@@ -12,7 +12,7 @@ export function NuggetsHostPortal() {
|
||||
const [hostName, setHostName] = useState('')
|
||||
const [seafileConfigured, setSeafileConfigured] = useState(true)
|
||||
|
||||
const [username, setUsername] = useState('')
|
||||
const [email, setEmail] = useState('')
|
||||
const [password, setPassword] = useState('')
|
||||
const [loginError, setLoginError] = useState('')
|
||||
const [loggingIn, setLoggingIn] = useState(false)
|
||||
@@ -48,7 +48,7 @@ export function NuggetsHostPortal() {
|
||||
const r = await fetch('/api/nuggets-upload/login', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ username, password }),
|
||||
body: JSON.stringify({ email, password }),
|
||||
})
|
||||
const d = await r.json()
|
||||
if (!r.ok) { setLoginError(d.message ?? 'Login failed.'); return }
|
||||
@@ -63,7 +63,7 @@ export function NuggetsHostPortal() {
|
||||
await fetch('/api/nuggets-upload/logout', { method: 'POST' })
|
||||
setAuthenticated(false)
|
||||
setHostName('')
|
||||
setUsername('')
|
||||
setEmail('')
|
||||
setPassword('')
|
||||
setSubmitted([])
|
||||
resetForm()
|
||||
@@ -166,9 +166,9 @@ export function NuggetsHostPortal() {
|
||||
<p style={s.subText}>Sign in with your host credentials to submit an episode.</p>
|
||||
<form onSubmit={handleLogin} style={s.form}>
|
||||
<div style={s.field}>
|
||||
<label style={s.label} htmlFor="hp-u">Username</label>
|
||||
<input id="hp-u" style={s.input} type="text" autoComplete="username"
|
||||
value={username} onChange={e => setUsername(e.target.value)} disabled={loggingIn} required />
|
||||
<label style={s.label} htmlFor="hp-u">Email</label>
|
||||
<input id="hp-u" style={s.input} type="email" autoComplete="email"
|
||||
value={email} onChange={e => setEmail(e.target.value)} disabled={loggingIn} required />
|
||||
</div>
|
||||
<div style={s.field}>
|
||||
<label style={s.label} htmlFor="hp-p">Password</label>
|
||||
|
||||
Reference in new issue
Block a user