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 pageGET /oauth/callback
for the callback pageGET /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())
]
});
Parameters
oauthConfig: OAuth2ClientConfig
optional
options: KvOAuthPluginOptions