feat(auth): enhance security and audit logging
- Integrate webhook alerts for admin login lockouts. - Implement detailed audit logging for login, logout, and setup actions. - Improve client revocation event tracking. - Standardize error handling in profile updates. - Enforce 'operator' role for event API access.
This commit is contained in:
1 parent
5c977d6977
commit
8132087085
52 files changed
+4434
-407
No files matched your search
@@ -125,9 +125,13 @@ export async function PUT(request: NextRequest) {
|
||||
});
|
||||
|
||||
if (!result.ok) {
|
||||
const isConflict = result.code === "ADMIN_EMAIL_CONFLICT";
|
||||
return NextResponse.json(
|
||||
{ error: result.error, code: "INVALID_PASSWORD" },
|
||||
{ status: 401 },
|
||||
{
|
||||
error: result.error,
|
||||
code: result.code || "INVALID_PASSWORD",
|
||||
},
|
||||
{ status: isConflict ? 409 : 401 },
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user