feat: Docker部署与CI/CD集成, 搜索栏修复, 上传目录改为data
This commit is contained in:
15
pages/api/v1/auth/logout.ts
Normal file
15
pages/api/v1/auth/logout.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { NextApiRequest, NextApiResponse } from 'next';
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
if (req.method !== 'POST') {
|
||||
return res.status(405).json({ success: false, error: 'Method not allowed' });
|
||||
}
|
||||
|
||||
// Clear the authentication cookie
|
||||
res.setHeader('Set-Cookie', 'token=; HttpOnly; Path=/; Max-Age=0; SameSite=Strict');
|
||||
|
||||
return res.status(200).json({
|
||||
success: true,
|
||||
message: 'Logged out successfully'
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user