We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can u please help for the logout?
The text was updated successfully, but these errors were encountered:
Just make a api route to delete all cookies.
Sorry, something went wrong.
If still needed, here is a solution
/api/logout.ts
import { NextApiRequest, NextApiResponse } from "next"; import { serialize } from "cookie"; // Get our environment variables const { COOKIE_NAME } = process.env; export default async (_: NextApiRequest, res: NextApiResponse) => { // remove cookie from request header res.setHeader("Set-Cookie", [ serialize(COOKIE_NAME, "", { maxAge: -1, path: "/", }), ]); res.writeHead(302, { Location: "/" }); res.end(); };
Successfully merging a pull request may close this issue.
Can u please help for the logout?
The text was updated successfully, but these errors were encountered: