ManagedLoginBranding
Source:
src/AWS/Cognito/ManagedLoginBranding.ts
A managed login branding style for an Amazon Cognito user pool app
client. Assigning a style (even just Cognito’s provided defaults) is what
activates the hosted managed login pages — a UserPoolDomain with
managedLoginVersion: 2 serves them end-to-end without any console step.
Activating Managed Login
Section titled “Activating Managed Login”import * as Cognito from "alchemy/AWS/Cognito";
const pool = yield* Cognito.UserPool("Users", {});const client = yield* Cognito.UserPoolClient("Web", { userPoolId: pool.userPoolId, callbackUrls: ["https://example.com/callback"], allowedOAuthFlowsUserPoolClient: true, allowedOAuthFlows: ["code"], allowedOAuthScopes: ["openid", "email"],});const domain = yield* Cognito.UserPoolDomain("AuthDomain", { userPoolId: pool.userPoolId, managedLoginVersion: 2,});yield* Cognito.ManagedLoginBranding("Branding", { userPoolId: pool.userPoolId, clientId: client.clientId,});Custom Branding
Section titled “Custom Branding”yield* Cognito.ManagedLoginBranding("Branding", { userPoolId: pool.userPoolId, clientId: client.clientId, settings: brandingSettings, // designer-exported JSON document assets: [{ category: "FORM_LOGO", colorMode: "LIGHT", extension: "PNG", bytes: logoBytes, }],});