/** * @flink-app/oauth-plugin * * OAuth 2.0 plugin for Flink supporting GitHub and Google providers * with JWT token integration and flexible user management. * * @example * ```typescript * import { jwtAuthPlugin } from '@flink-app/jwt-auth-plugin'; * import { oauthPlugin } from '@flink-app/oauth-plugin'; * * const app = new FlinkApp({ * plugins: [ * jwtAuthPlugin({ ... }), * oauthPlugin({ * providers: { * github: { * clientId: process.env.GITHUB_CLIENT_ID!, * clientSecret: process.env.GITHUB_CLIENT_SECRET!, * callbackUrl: 'https://myapp.com/oauth/github/callback' * } * }, * onAuthSuccess: async ({ profile }, ctx) => { * const user = await ctx.repos.userRepo.getOne({ email: profile.email }); * const token = await ctx.plugins.jwtAuth.createToken({ userId: user._id }, ['user']); * return { user, token }; * } * }) * ] * }); * ``` */ export { oauthPlugin } from "./OAuthPlugin"; export type { OAuthPluginOptions, OAuthError, AuthSuccessCallbackResponse, AuthErrorCallbackResponse } from "./OAuthPluginOptions"; export type { OAuthPluginContext } from "./OAuthPluginContext"; export type { OAuthInternalContext } from "./OAuthInternalContext"; export type { OAuthProvider, OAuthTokens, OAuthProfile, AuthorizationUrlParams, TokenExchangeParams, ProviderConfig } from "./providers/OAuthProvider"; export { GitHubProvider } from "./providers/GitHubProvider"; export { GoogleProvider } from "./providers/GoogleProvider"; export { OAuthProviderBase } from "./providers/OAuthProviderBase"; export { getProvider, type ProviderName } from "./providers/ProviderRegistry"; export type { default as OAuthSession } from "./schemas/OAuthSession"; export type { default as OAuthConnection } from "./schemas/OAuthConnection"; export { default as OAuthSessionRepo } from "./repos/OAuthSessionRepo"; export { default as OAuthConnectionRepo } from "./repos/OAuthConnectionRepo"; export { encryptToken, decryptToken, validateEncryptionSecret } from "./utils/encryption-utils"; export { generateState, validateState } from "./utils/state-utils"; export { createOAuthError, handleProviderError } from "./utils/error-utils";