You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
347 B
11 lines
347 B
2 years ago
|
import { redirect } from "next/dist/next-server/server/api-utils"
|
||
|
|
||
|
export default async function exit(req, res) {
|
||
|
// Exit the current user from "Preview Mode". This function accepts no args.
|
||
|
res.clearPreviewData()
|
||
|
|
||
|
// Redirect the user back to a provided redirect path or the index page
|
||
|
res.writeHead(307, { Location: "/" })
|
||
|
res.end()
|
||
|
}
|