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>
This commit is contained in:
15
app/api/logout/route.ts
Normal file
15
app/api/logout/route.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user