authentication

Manage authentication and authorization with Better Auth 1.x and Google OAuth.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/juanjaragavi/social-media-genius --skill authentication-juanjaragavi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: authentication
Source: https://github.com/juanjaragavi/social-media-genius/tree/main/.claude/skills/authentication
Command: npx skills add https://github.com/juanjaragavi/social-media-genius --skill authentication-juanjaragavi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill centralizes authentication and authorization across TopNetworks projects, enabling domain-restricted access and robust session management with Better Auth 1.x and Google OAuth.

Core Features & Use Cases

  • Login flows, session checks, and protected routes
  • OAuth integration with Google accounts (and optional Drive access)
  • Domain restriction enforcement and server-side guards

Quick Start

Install and configure Better Auth in your project and initiate a Google OAuth login flow.

Frequently Asked Questions about authentication

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

FAQPage Schema
How do I secure routes with Better Auth and Google OAuth in a Next.js app?

Better Auth handles authentication by managing server-side session guards and client helpers, enforcing protected routes and domain restrictions when users log in via Google OAuth across multi-project environments.

Can I restrict app access to specific email domains using Better Auth?

Yes, you can enforce domain restriction by applying server-side guards within your authentication flow, ensuring only users from approved domains can access protected routes after Google OAuth login.

How do I set up server-side session management for multi-project environments?

Server-side session management is set up by applying server middleware and database migrations across projects, providing a clear separation of concerns for scalable access control in multi-project environments.

What is needed to integrate Google OAuth and optional Drive access into my login flow?

Integrating Google OAuth requires installing and configuring Better Auth 1.x in your project to initiate the login flow, which can be extended to request optional Google Drive access permissions for users.

Does Better Auth 1.x support Next.js middleware for protected routes?

Yes, Better Auth 1.x supports Next.js by providing server middleware and client helpers that allow you to validate sessions and guard protected routes effectively on the server side.