Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fathym_common/src/src.deps.ts>DenoKVOAuth.handleCallback

The Fathym Reference Architecture provides the common foundation for applications built in Typescript.
Go to Latest
function DenoKVOAuth.handleCallback
Re-export
import { DenoKVOAuth } from "https://deno.land/x/fathym_common@v0.0.141/src/src.deps.ts";
const { handleCallback } = DenoKVOAuth;

Handles the OAuth callback request for the given OAuth configuration, and then redirects the client to the success URL set in signIn. The request URL must match the redirect URL of the OAuth application.

Examples

Example 1

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

const oauthConfig = createGitHubOAuthConfig();

export async function handleOAuthCallback(request: Request) {
  const { response, tokens, sessionId } = await handleCallback(
    request,
    oauthConfig,
  );

   // Perform some actions with the `tokens` and `sessionId`.

   return response;
}

Parameters

request: Request
oauthConfig: OAuth2ClientConfig
optional
options: HandleCallbackOptions

Returns

Promise<{ response: Response; sessionId: string; tokens: Tokens; }>