@orcestr/auth-next
v0.4.0
Published
Next.js proxy and server redirect helpers for Orcestr authentication.
Maintainers
Readme
@orcestr/auth-next
Тонкие Next.js proxy и server redirect helpers для @orcestr/auth-core. Пакет не содержит
страниц или product route registry.
Установка
npm install @orcestr/auth-core @orcestr/auth-next nextИспользование
import { authLoginRedirect } from '@orcestr/auth-next';
export function proxy(request: NextRequest) {
return authLoginRedirect(request, {
accessCookieName: 'orcestr_access',
refreshCookieName: 'orcestr_refresh',
loginPath: '/login',
isProtectedPath: (pathname) => pathname.startsWith('/dashboard/'),
});
}Exports: hasAuthSession, authLoginRedirect и requestAuthNext.
Consumer определяет public/protected routes, host-aware visible paths и итоговую навигацию. Так сохраняется единая redirect safety policy без переноса application pages в библиотеку.
