Skip to main content
Module

x/deno_kv_oauth/mod.ts>kvOAuthPlugin

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

Creates a basic plugin for the [Fresh]https://fresh.deno.dev/ web framework.

This creates handlers for the following routes:

  • GET /oauth/signin for the sign-in page
  • GET /oauth/callback for the callback page
  • GET /oauth/signout for the sign-out page
// main.ts
import { start } from "$fresh/server.ts";
import { createGitHubOAuthConfig, kvOAuthPlugin } from "https://deno.land/x/deno_kv_oauth@$VERSION/mod.ts";
import manifest from "./fresh.gen.ts";

await start(manifest, {
  plugins: [
    kvOAuthPlugin(createGitHubOAuthConfig())
  ]
});