import { signIn } from "https://deno.land/x/deno_kv_oauth@v0.2.7/mod.ts";
Handles the sign-in process for a given OAuth 2.0 client and redirects the client to the authorization URL.
It does this by:
- Using a randomly generated state to construct the OAuth 2.0 provider's authorization URL and code verifier.
- Storing an OAuth 2.0 session object that contains the state and code verifier in KV. The OAuth 2.0 session object will be used in the callback handler to get the OAuth 2.0 tokens from the given provider.
- Returning a response that sets the client's OAuth 2.0 session cookie and redirects the client to the OAuth 2.0 provider's authorization URL.
Parameters
oauth2Client: OAuth2Client