Files
external-app/app/api/logout/route.ts
zhangheng f737603b0c chore: initial commit of external-app SSO consumer
Next.js sample application that integrates with the mock SSO service:
redirects to sso-mock for login, receives the one-time sso_code on its
/callback route, and exchanges it for user info to establish a session.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 18:11:23 +08:00

16 lines
408 B
TypeScript

import { NextResponse } from 'next/server'
/**
* 退出登录
* 清除所有认证相关 Cookie。
*/
export async function POST() {
const response = NextResponse.json({ success: true })
response.cookies.set('user', '', { path: '/', maxAge: 0 })
response.cookies.set('token', '', { path: '/', maxAge: 0 })
response.cookies.set('refresh_token', '', { path: '/', maxAge: 0 })
return response
}