auth-pages

Implement passwordless Magic Link authentication with server-side session checks in Next.js 16.

2|Updated Dec 3, 2025
One-click install
npx skills add https://github.com/atilladeniz/next-go-pg --skill auth-pages
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-pages
Source: https://github.com/atilladeniz/next-go-pg/tree/main/.claude/skills/auth-pages
Command: npx skills add https://github.com/atilladeniz/next-go-pg --skill auth-pages

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a robust, server-side first approach to building authentication pages in Next.js, eliminating common UI flicker issues and ensuring a smooth user experience. It streamlines the implementation of secure login, registration, and protected routes, saving you from complex client-side session management.

Core Features & Use Cases

  • Server-Side Session Handling: Implements flicker-free session checks for protected pages, improving perceived performance.
  • Cross-Tab Synchronization: Ensures authentication state is consistent across multiple browser tabs using broadcast-channel.
  • Auth Client for Actions: Guides on using client-safe functions (signIn, signOut) only for user interactions, not session checks.
  • Use Case: When creating a new protected page like /settings, use this skill to implement server-side session checks and ensure a flicker-free user experience by avoiding client-side useSession() and redirecting unauthenticated users instantly.

Quick Start

Describe the recommended pattern for creating a new protected page in Next.js using server-side session checks to prevent UI flicker and ensure immediate redirection for unauthenticated users.

Frequently Asked Questions about auth-pages

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent UI flicker when checking authentication on protected Next.js routes?

Server-side session checks using getSession prevent flicker by validating authentication before the page renders, eliminating client-side delays. Redirect unauthenticated users instantly without showing the protected content first, ensuring a seamless user experience on protected routes.

How do I implement passwordless Magic Link authentication in Next.js?

Passwordless Magic Link authentication uses email-based sign-in instead of passwords. Implement it with signIn.magicLink for client actions, backend email delivery via webhooks, and server-side session validation to create secure login and verification pages in Next.js 16 apps.

What's the best way to keep authentication state synchronized across browser tabs?

Cross-tab synchronization uses broadcast-channel to share authentication state changes across multiple tabs instantly. This ensures users remain logged out or in across all browser windows when they sign out or when their session expires.

Can I build protected pages without client-side useSession checks in Next.js?

Yes, server-side session checks eliminate the need for client-side useSession hooks. Use getSession to validate the session before rendering the page, which prevents flicker and removes the requirement for client-side session management on protected routes.

Does this approach include rate limiting for authentication attempts?

Yes, the implementation covers rate limiting as part of backend email delivery via webhooks, protecting your authentication system from brute-force attacks and abuse during login and verification flows.

What UI components are included for building login and session management interfaces?

The Skill provides UI components architecture for login pages, verification pages, email verification UI, and protected dashboards. These components integrate with server-side session handling and Magic Link flows for complete authentication page implementations.