release: v0.17.0 (#677)
See CHANGELOG.md, section [0.17.0] — 2026-09-23.
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
MAX_PASSWORD_LENGTH,
|
||||
} from '@/lib/admin/auth';
|
||||
import { checkRateLimit, getClientIp, retryAfterSeconds } from '@/lib/rate-limit';
|
||||
import { isHttpsRequest } from '@/lib/auth';
|
||||
|
||||
/** Admin login attempts per minute per IP — the highest-value credential in the app. */
|
||||
const ADMIN_AUTH_RPM = 5;
|
||||
@@ -53,7 +54,7 @@ export async function POST(request: NextRequest) {
|
||||
|
||||
response.cookies.set(COOKIE_NAME, token, {
|
||||
httpOnly: true,
|
||||
secure: process.env.NODE_ENV === 'production',
|
||||
secure: isHttpsRequest(request),
|
||||
sameSite: 'strict',
|
||||
path: '/',
|
||||
maxAge: SESSION_DURATION_MS / 1000,
|
||||
@@ -73,11 +74,11 @@ export async function GET() {
|
||||
}
|
||||
|
||||
/** DELETE: Logout. */
|
||||
export async function DELETE() {
|
||||
export async function DELETE(request: NextRequest) {
|
||||
const response = NextResponse.json({ success: true });
|
||||
response.cookies.set(COOKIE_NAME, '', {
|
||||
httpOnly: true,
|
||||
secure: process.env.NODE_ENV === 'production',
|
||||
secure: isHttpsRequest(request),
|
||||
sameSite: 'strict',
|
||||
path: '/',
|
||||
maxAge: 0,
|
||||
|
||||
Reference in New Issue
Block a user