fix(auth): password min length 6 + show/hide toggle on password inputs
Build & Push Docker Image / build (push) Successful in 2m21s
Build & Push Docker Image / build (push) Successful in 2m21s
This commit is contained in:
@@ -17,6 +17,7 @@ import { useAuth } from "@/hooks/use-auth";
|
||||
import { Layout } from "@/components/layout";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { PasswordInput } from "@/components/password-input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card";
|
||||
@@ -115,8 +116,8 @@ export default function Admin() {
|
||||
|
||||
const handleSetUserPassword = () => {
|
||||
if (!editUser || !editPassword) return;
|
||||
if (editPassword.length < 8) {
|
||||
toast({ title: "Password too short", description: "Minimum 8 characters.", variant: "destructive" });
|
||||
if (editPassword.length < 6) {
|
||||
toast({ title: "Password too short", description: "Minimum 6 characters.", variant: "destructive" });
|
||||
return;
|
||||
}
|
||||
setUserPassword.mutate(
|
||||
@@ -367,7 +368,7 @@ export default function Admin() {
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label>Password</Label>
|
||||
<Input type="password" value={newPassword} onChange={(e) => setNewPassword(e.target.value)} placeholder="min. 6 characters" />
|
||||
<PasswordInput value={newPassword} onChange={(e) => setNewPassword(e.target.value)} placeholder="min. 6 characters" />
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
<Label>Email (Optional)</Label>
|
||||
@@ -448,11 +449,10 @@ export default function Admin() {
|
||||
{editUser?.authProvider !== "oidc" ? (
|
||||
<div className="space-y-2 border-t pt-4">
|
||||
<Label>Set Password</Label>
|
||||
<Input
|
||||
type="password"
|
||||
<PasswordInput
|
||||
value={editPassword}
|
||||
onChange={(e) => setEditPassword(e.target.value)}
|
||||
placeholder="min. 8 characters"
|
||||
placeholder="min. 6 characters"
|
||||
data-testid="input-set-password"
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">Resets the user's password immediately.</p>
|
||||
|
||||
Reference in New Issue
Block a user