From website-deployment
Adds Cognito authentication and route protection. Use when adding login, signup, authentication, or user management.
npx claudepluginhub schuettc/website-deployment-plugin --plugin website-deploymentThis skill uses the workspace's default tool permissions.
You are adding Cognito authentication to protect API routes and manage user accounts.
Scaffolds signin and signup authentication endpoints for Next.js, Express, FastAPI, Go projects with Prisma, Drizzle, PostgreSQL, SQLAlchemy, and database/JWT sessions. Use for adding login/register flows from scratch.
Implements fullstack auth flows: login/signup/forgot-password pages, JWT+refresh tokens, session auth, social login (Google/GitHub/Apple), MFA/2FA, protected routes via middleware, role-based UI. Use for adding auth/authorization.
Backend API authentication patterns with Clerk JWT middleware and route protection. Use when building REST APIs, GraphQL APIs, protecting backend routes, implementing JWT validation, setting up Express middleware, or when user mentions API authentication, backend security, JWT tokens, or protected endpoints.
Share bugs, ideas, or general feedback.
You are adding Cognito authentication to protect API routes and manage user accounts.
Based on the migration plan, show the user:
Explain the auth flow before asking questions: "Here's how authentication will work in your app:
Ask the user:
Create infrastructure/lib/auth-stack.ts
Add Cognito Authorizer to API Gateway
api-stack.ts to:
Create React auth integration (if frontend exists)
cd frontend && npm install amazon-cognito-identity-jsfrontend/src/lib/auth.ts with:
signUp(email, password), confirmSignUp(email, code), signIn(email, password)signOut(), getSession(), getIdToken()VITE_COGNITO_USER_POOL_ID, VITE_COGNITO_CLIENT_IDfrontend/src/hooks/useAuth.ts — manages auth state, provides auth functions, checks session on mountfrontend/src/context/AuthContext.tsx — wraps app to provide auth statefrontend/src/components/:
SignInForm.tsx, SignUpForm.tsx, ConfirmSignUp.tsx, ProtectedRoute.tsxUpdate API client to include auth token:
Update frontend/src/lib/api.ts:
import { getIdToken } from './auth';
export async function apiFetch(path: string, options?: RequestInit) {
const token = await getIdToken();
const headers: Record<string, string> = {
'Content-Type': 'application/json',
...options?.headers as Record<string, string>,
};
if (token) {
headers['Authorization'] = `Bearer ${token}`;
}
const response = await fetch(`${API_BASE}${path}`, { ...options, headers });
if (!response.ok) throw new Error(`API error: ${response.status}`);
return response.json();
}
Update React Router to protect routes:
<Route path="/dashboard" element={
<ProtectedRoute>
<DashboardPage />
</ProtectedRoute>
} />
cd infrastructure && npx cdk synth to verify compilation.migration/plan.md to mark add-auth as completeno-reply@verificationemail.com.