Skip to main content
Module

x/deno_kv_oauth/mod.ts>signOut

High-level OAuth 2.0 powered by Deno KV.
Go to Latest
function signOut
Re-export
import { signOut } from "https://deno.land/x/deno_kv_oauth@v0.9.0/mod.ts";

Handles the sign-out process, and then redirects the client to the given success URL.

It does this by:

  1. Getting the OAuth session ID from the cookie in the given request. If no OAuth session cookie is found, a response that redirects the client to the given redirect URL is returned.
  2. Returning a response that invalidates the client's session cookie and redirects the client to the given success URL.

See "Redirect URL after Sign-In or Sign-Out" section in the README for more information on the success URL.

Examples

Example 1

import { signOut } from "https://deno.land/x/deno_kv_oauth@$VERSION/mod.ts";

export async function signOutHandler(request: Request) {
  return signOut(request);
}