nextjs-supabase-auth
Build Next.js Authentication with Supabase
Authentication across browser, server, middleware, and callback contexts is easy to configure incorrectly. This skill provides focused Supabase Auth patterns for Next.js App Router.
Stop for confirmation before installing.
Review the plan and obtain explicit user consent before changing files.
Install with my Agent
Copy this request to your Agent. It includes the canonical Skill page and manifest.
Review the Skillstore skill "nextjs-supabase-auth" from https://skillstore.io/skills/sickn33-nextjs-supabase-auth.md and its manifest at https://skillstore.io/api/skills/sickn33-nextjs-supabase-auth/manifest. Verify the artifact. Stop and obtain explicit user consent before installing or changing files.Your Agent should still show its plan and request any confirmation required by the security policy.
Agent-readable resources
Use these links when an AI agent, crawler, or script needs clean context instead of reading the full page.
Test it
Using "nextjs-supabase-auth". Review my dashboard protection, which checks a browser session after the page loads.
Expected outcome:
- Finding: client-only protection can briefly expose protected content.
- Recommendation: verify the user on the server and enforce access in middleware.
- Validation: test direct navigation with expired and missing sessions.
Using "nextjs-supabase-auth". Plan Supabase OAuth for Google in an App Router application.
Expected outcome:
- Create a provider sign-in action with the deployed callback URL.
- Exchange the callback code for a session on the server.
- Validate the return path as a local route before redirecting.
- Test success, denial, expired code, and malformed return-path cases.
Security Audit
High RiskThe command-execution alerts are false positives caused by JavaScript template literals, Markdown fences, and inline Markdown. Public Supabase environment variables are expected, but the OAuth callback contains a high-severity open redirect through its unvalidated next parameter.
Confirmed security concerns (1)
Risk Factors
⚙️ External commands (7)
Share & cite this report
Share the versioned assessment report, neutral badge, embed card, and citations. Skillstore reports evidence without deciding whether this Skill is safe.
Copy report link
https://skillstore.io/skills/sickn33-nextjs-supabase-auth/audits/6?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown badge
[](https://skillstore.io/skills/sickn33-nextjs-supabase-auth?utm_source=security_passport_badge)HTML badge
<a href="https://skillstore.io/skills/sickn33-nextjs-supabase-auth?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/sickn33-nextjs-supabase-auth/security.svg" alt="Skillstore security assessment" loading="lazy"></a>Embed card
<iframe src="https://skillstore.io/embed/skills/sickn33-nextjs-supabase-auth.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>Academic citations (APA · BibTeX · CFF)
APA citation
sickn33. (2026). nextjs-supabase-auth security audit report (audit version 6) [Author version unspecified]. Skillstore. https://skillstore.io/skills/sickn33-nextjs-supabase-auth/audits/6BibTeX citation
@techreport{sickn33-sickn33-nextjs-supabase-auth-2026,
author = {sickn33},
title = {nextjs-supabase-auth security audit report (audit version 6)},
institution = {Skillstore},
year = {2026},
number = {6},
url = {https://skillstore.io/skills/sickn33-nextjs-supabase-auth/audits/6},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "nextjs-supabase-auth security audit report (audit version 6)"
version: "unspecified"
type: report
authors:
- name: "sickn33"
date-released: "2026-08-04"
url: "https://skillstore.io/skills/sickn33-nextjs-supabase-auth/audits/6"
identifiers:
- type: other
value: "skillstore:sickn33-nextjs-supabase-auth:audit:6"
description: "Skillstore immutable audit report identifier"
Skillstore Score
Why this score Evidence Confidence: HighWhat You Can Build
Add Authentication to a New Application
Create browser and server clients, login actions, callback handling, and protected routes for a new App Router project.
Review an Existing Auth Integration
Identify insecure session checks, missing middleware, incorrect clients, weak redirect handling, and absent error handling.
Standardize Team Auth Patterns
Define consistent Supabase Auth conventions for server components, server actions, middleware, and OAuth callbacks.
Try These Prompts
Set up Supabase browser and server clients for my Next.js App Router project. Explain the required public environment variables and cookie handling.
Add Supabase authentication middleware to protect these routes: [ROUTES]. Refresh sessions and redirect unauthenticated users to [LOGIN_PATH].
Implement Supabase OAuth for [PROVIDER] in Next.js. Include a callback route, validated local redirects, error handling, and production URL considerations.
Audit my Next.js Supabase Auth implementation. Check client boundaries, verified user retrieval, middleware coverage, redirect validation, cookie updates, errors, and cache revalidation.
Best Practices
- Use getUser for security decisions because it verifies the authentication token.
- Keep browser and server Supabase clients separate and update cookies through supported server interfaces.
- Validate callback destinations as local paths before redirecting authenticated users.
Avoid
- Do not trust getSession alone for server-side authorization checks.
- Do not expose Supabase service-role keys through public environment variables.
- Do not concatenate untrusted query values into authentication redirects.
Frequently Asked Questions
Which Next.js architecture does this skill support?
Does the Supabase anonymous key need to remain secret?
Why should authorization checks use getUser?
Can this skill configure Google or GitHub OAuth consoles?
Does this skill create row-level security policies?
What should be tested before deployment?
Developer Details
Author
sickn33License
MIT
Skillstore revision
r2
Version notice
The author did not declare a version.
Repository
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/nextjs-supabase-authRef
81e05e636292629114b76cbb3922fbe57672fc02
Maintenance freshness
8/5/2026
Usage
10 downloads · 120 views
File structure
📄 SKILL.md