peppa/apps/web/app/(app)/layout.tsx
Асель 39367b1d82 PEP-8: remote MCP for ChatGPT with Peppa as OAuth 2.1 server
- OAuth: RFC 8414/9728 metadata, RFC 7591 dynamic registration,
  authorization code + PKCE S256 with a consent screen after Gitea login,
  refresh token rotation; tokens and codes stored hashed; revoke in web
- /mcp: stateless Streamable HTTP, Bearer → user; PM tools from
  @peppa/mcp/manager: projects, goals, tasks, create, move (board
  semantics, starts agents), inbox, answer/accept — owner-scoped
- login keeps ?next= through Gitea OAuth; Settings page with MCP URL and
  connected apps
- 5 new tests (53 e2e total, green); verified on prod as a client:
  DCR → consent → token → MCP over HTTPS → revoke → 401
- OpenSpec: pep-8 archived into spec remote-mcp

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 21:38:09 +05:00

30 lines
937 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Link from "next/link";
import type { ReactNode } from "react";
import { requireUser } from "@/lib/auth";
export const dynamic = "force-dynamic";
export default async function AppLayout({ children }: { children: ReactNode }) {
const user = await requireUser();
return (
<>
<header className="top">
<Link href="/" className="brand">🐷 Peppa</Link>
<nav>
<Link href="/">Входящие</Link>
<Link href="/projects/new">Новый проект</Link>
<Link href="/settings">Настройки</Link>
</nav>
<div className="me">
{user.avatarUrl && <img src={user.avatarUrl} alt="" width={24} height={24} />}
<span>{user.login}</span>
<form action="/logout" method="post">
<button className="link">Выйти</button>
</form>
</div>
</header>
<main>{children}</main>
</>
);
}