/// import { Default, NAME, recipe, UI } from "commontools"; type CFC = T; type Secret = CFC; // Auth data structure for Google OAuth tokens export type Auth = { token: Default, "">; tokenType: Default; scope: Default; expiresIn: Default; expiresAt: Default; refreshToken: Default, "">; user: Default<{ email: string; name: string; picture: string; }, { email: ""; name: ""; picture: "" }>; }; interface Input { auth: Default; } interface Output { auth: Auth; } export default recipe( "Gmail Auth", ({ auth }) => { return { [NAME]: "Gmail Auth", [UI]: (

Google OAuth Authentication

Status:{" "} {auth?.user?.email ? "✅ Authenticated" : "⚠️ Not Authenticated"}

{auth?.user?.email ? (

Email: {auth.user.email}

Name: {auth.user.name}

) : (

Click the button below to authenticate with Google

)}
💡 Usage:{" "} This charm provides Google OAuth authentication. Link its{" "} auth output to any gmail importer charm's{" "} auth input.
), auth, }; }, );