fix: update admin page for passwordless authentication
- Remove handleResetPassword function (no longer needed with Magic Links) - Change password reset button to send Magic Link instead - Update button icon from KeyRound to Mail - Update button tooltip to reflect new Magic Link flow - Remove unused KeyRound import
This commit is contained in:
parent
2016767dcb
commit
fe4907ee46
|
|
@ -22,7 +22,6 @@ import {
|
||||||
Shield,
|
Shield,
|
||||||
ShieldOff,
|
ShieldOff,
|
||||||
Trash2,
|
Trash2,
|
||||||
KeyRound,
|
|
||||||
Mail,
|
Mail,
|
||||||
RefreshCw,
|
RefreshCw,
|
||||||
LogOut,
|
LogOut,
|
||||||
|
|
@ -156,20 +155,6 @@ export default function AdminPage() {
|
||||||
setActionLoading(null);
|
setActionLoading(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleResetPassword = async (userId: number) => {
|
|
||||||
if (!confirm("Passwort zuruecksetzen? Der User erhaelt eine Email mit dem neuen Passwort.")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setActionLoading(userId);
|
|
||||||
const { data, error } = await adminApi.resetPassword(userId);
|
|
||||||
if (error) {
|
|
||||||
setError(error);
|
|
||||||
} else {
|
|
||||||
showSuccess(data?.message || "Passwort zurueckgesetzt");
|
|
||||||
}
|
|
||||||
setActionLoading(null);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleResendVerification = async (userId: number) => {
|
const handleResendVerification = async (userId: number) => {
|
||||||
setActionLoading(userId);
|
setActionLoading(userId);
|
||||||
const { data, error } = await adminApi.resendVerification(userId);
|
const { data, error } = await adminApi.resendVerification(userId);
|
||||||
|
|
@ -488,14 +473,14 @@ export default function AdminPage() {
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Passwort zuruecksetzen */}
|
{/* Login-Link erneut senden */}
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => handleResetPassword(u.id)}
|
onClick={() => handleResendVerification(u.id)}
|
||||||
title="Passwort zuruecksetzen"
|
title="Login-Link erneut senden"
|
||||||
>
|
>
|
||||||
<KeyRound className="h-4 w-4" />
|
<Mail className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{/* Container loeschen */}
|
{/* Container loeschen */}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user