Skip to content

Feat/docs#524

Open
ratracegrad wants to merge 17 commits into
atinux:mainfrom
ratracegrad:feat/docs
Open

Feat/docs#524
ratracegrad wants to merge 17 commits into
atinux:mainfrom
ratracegrad:feat/docs

Conversation

@ratracegrad
Copy link
Copy Markdown

@ratracegrad ratracegrad commented May 20, 2026

The documentation for Nuxt Auth Utils is in the README file. I have added Nuxt Content to create a website that will display a landing page and then a documentation page.

Website follows the layout as well as look and feel of other nuxt ecosystems like Nuxt Content and Nuxt UI.

The landing page looks like this:
Lading Page

The documentation page looks like this:
Documentation Page

Summary by CodeRabbit

  • New Features

    • Complete docs site: header, footer, logo, layouts, searchable content, OG image support, dark mode, and catch‑all docs routing.
    • Landing "Get started" page and a copy‑to‑clipboard input component.
  • Documentation

    • Extensive guides covering installation, configuration, session management, OAuth (40+ providers), password hashing, WebAuthn/passkeys, AT Protocol, WebSocket security, hybrid rendering, and session extension.
  • Chores

    • Local docs build/config and workspace integration added.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 73b69526-a1c0-4d9a-98b2-e84b0426c574

📥 Commits

Reviewing files that changed from the base of the PR and between 2bfc03b and 0eb117a.

📒 Files selected for processing (1)
  • docs/app/components/AppFooter.vue
✅ Files skipped from review due to trivial changes (1)
  • docs/app/components/AppFooter.vue

📝 Walkthrough

Walkthrough

Adds a self-contained Nuxt documentation site for nuxt-auth-utils: app configuration, global styles, UI components, layouts, pages with SEO/OG, extensive content guides (installation, configuration, sessions, OAuth, hashing, WebAuthn, AT Protocol, advanced patterns), and workspace/package updates.

Changes

Documentation Application

Layer / File(s) Summary
App configuration and Nuxt setup
docs/app.config.ts, docs/nuxt.config.ts, docs/content.config.ts, docs/app/assets/css/main.css, docs/package.json, docs/tsconfig.json
Nuxt color tokens, devtools/modules, Content collection, global Tailwind/Nuxt UI CSS, and docs package metadata with scripts and TS config.
Header, footer, and logo components
docs/app/components/AppHeader.vue, docs/app/components/AppLogo.vue, docs/app/components/AppFooter.vue
Header with navigation and controls, SVG logo component, and footer with LICENSE and GitHub link.
Root app, layouts, and content rendering
docs/app/app.vue, docs/app/layouts/default.vue, docs/app/layouts/docs.vue
Root app fetches navigation/search data and provides it; default and docs layouts compose header, sidebar navigation, main content, and footer.
Pages and reusable utility components
docs/app/pages/index.vue, docs/app/pages/[...slug].vue, docs/app/components/UInputCopy.vue, docs/app/components/OgImage/AuthUtils.takumi.vue
Homepage with features and install command input, catch-all docs page with SEO/OG and content rendering, copy-to-clipboard input component, and OpenGraph image component.

Documentation Content

Layer / File(s) Summary
Getting Started guides
docs/content/1.getting-started/*
Navigation metadata, installation flow, TypeScript augmentation for session types, module options (WebAuthn/AT Protocol/loadStrategy), session cookie settings, OAuth credentials, and hashing options.
Core usage: sessions and OAuth
docs/content/2.usage/{1.session.md,2.oauth.md}
Client useUserSession composable and server utilities (setUserSession, replaceUserSession, getUserSession, requireUserSession, clearUserSession); OAuth provider event-handler pattern with examples, env/runtime config, popup flow, and provider catalog.
Password hashing and validation
docs/content/2.usage/3.password-hashing.md
Scrypt-based hashing utilities (hashPassword, verifyPassword, passwordNeedsRehash) and configuration of scrypt parameters.
WebAuthn passkey implementation
docs/content/2.usage/4.webauthn.md
SimpleWebAuthn setup, server registration/auth handlers with credential persistence and counters, recommended single-use challenge workflow, client example, and credentials table schema.
AT Protocol (Bluesky) OAuth setup
docs/content/2.usage/5.atproto.md
AT Protocol packages and Nuxt flag, server callback using defineOAuthBlueskyEventHandler, auto-generated client-metadata.json behavior, and runtime config examples.
Advanced session and rendering patterns
docs/content/2.usage/{6.extend-session.md,7.hybrid-rendering.md,8.websocket.md}
Session hooks for enrichment/invalidation, hybrid rendering/session-loading constraints and AuthState usage, and WebSocket authentication via requireUserSession in upgrade/open handlers.

Workspace Configuration

Layer / File(s) Summary
Workspace and package configuration
package.json, pnpm-workspace.yaml, playground/app/pages/index.vue
Root package.json adds docs:dev/docs:build scripts and reorders devDependencies; pnpm workspace includes ./docs; playground provider icon identifiers corrected.

🎯 3 (Moderate) | ⏱️ ~25 minutes

🐰 Documentation hops through the garden,
Sessions secured with passing charts,
OAuth blooms across providers aplenty,
WebAuthn whispers passkey secrets,
A site well-grown for auth-keen hearts! 🌿✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Feat/docs' is vague and generic, using non-descriptive terms that don't convey meaningful information about the changeset. Use a more descriptive title that captures the main change, such as 'Add documentation website for Nuxt Auth Utils' or 'Migrate docs from README to Nuxt Content site'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🧹 Nitpick comments (1)
docs/app/components/UInputCopy.vue (1)

40-40: ⚡ Quick win

Consider a dynamic aria-label for better accessibility.

The button's visual state changes (icon switches from copy to check), but the aria-label remains static. Screen reader users would benefit from a dynamic label that reflects the current state.

♻️ Suggested improvement
-          aria-label="copy button"
+          :aria-label="copied ? 'Copied to clipboard' : 'Copy to clipboard'"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/app/components/UInputCopy.vue` at line 40, The aria-label is static;
make it dynamic by binding it to the component's copy state (e.g., replace
aria-label="copy button" with :aria-label="isCopied ? 'copied' : 'copy to
clipboard'") and ensure the reactive flag (e.g., isCopied) is set/cleared in the
copy handler (e.g., copyText or onCopy) so the label updates when the icon
switches between copy and check in UInputCopy.vue.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/app.config.ts`:
- Around line 1-8: Delete the redundant app.config.ts file that contains the
exported default defineAppConfig block (the one setting ui.colors with primary:
'green' and neutral: 'zinc'); Nuxt only merges the project-root app.config.ts,
so remove this duplicate file to eliminate dead code and keep the single root
app.config.ts as the source of truth.

In `@docs/app/components/AppFooter.vue`:
- Around line 9-15: The external NuxtLink elements (the NuxtLink that links to
the LICENSE and the other external NuxtLink in the footer) open in a new tab
without rel protection; update both NuxtLink components to include rel="noopener
noreferrer" alongside target="_blank" so external links are hardened (locate the
NuxtLink components in AppFooter.vue and add the rel attribute to each).

In `@docs/app/components/UInputCopy.vue`:
- Line 23: The class string assigned to the component's "base" (currently
containing "field-sizing-content min-w-[34ch] whitespace-nowrap") relies on the
unsupported-for-Firefox utility "field-sizing-content"; change this to provide a
Firefox-safe fallback or use CSS feature detection: keep the existing
"min-w-[34ch]" and "whitespace-nowrap" as fallbacks, add a Tailwind fallback
like "min-w-fit" or "min-w-min" alongside "field-sizing-content", or add a small
<style> block with `@supports` (min-width: min-content) { .your-class { /* use
field-sizing-content behavior */ } } `@supports` not (min-width: min-content) {
.your-class { min-width: 34ch; } }, and update the "base" reference to use that
class name (referencing the "base" variable and the class name you add) so
Firefox gets the fallback.

In `@docs/app/pages/index.vue`:
- Line 5: The homepage description constant description contains awkward wording
"secured & sealed cookies sessions"; update the string value assigned to
description so it reads naturally and grammatically (e.g., "Add authentication
to Nuxt applications with secure, sealed cookie sessions"), by editing the
description constant in docs/app/pages/index.vue.

In `@docs/content/2.usage/1.session.md`:
- Line 38: Update the API table entry for openInPopup to show the correct
parameter types: replace the Type cell value `() => void` with the full
signature `(route: string, size?: { width?: number, height?: number }) => void`
so the documentation reflects the actual function parameters (openInPopup,
route, size) and the optional size.width/size.height fields.
- Line 75: Update the documentation for getUserSession to accurately describe
its return shape: state that it always returns a session object (even when no
session exists) containing at least an id and data (data may be an empty
object), but may also include other stored session properties and an optional
user property; change the sentence "returns `{ id }` with an empty data object"
to reflect that additional session fields can be present and that user is
optional so callers know to check for their presence.

In `@docs/content/2.usage/4.webauthn.md`:
- Around line 92-101: The onSuccess handler calls
db.users.findByCredentialId(credential.id) and then uses user.id without
verifying the lookup; if findByCredentialId returns null/undefined the code will
throw. Add a null-check after calling db.users.findByCredentialId in the
onSuccess function (and before setUserSession) to handle the missing user: log
or return an appropriate auth error/response (or throw a controlled error)
instead of proceeding, and ensure you still update the credential counter only
when appropriate or handle that failure path consistently.

In `@docs/content/2.usage/5.atproto.md`:
- Around line 66-68: Update the example value for clientId (next to redirectURL)
to the full metadata document URL rather than just the origin; replace the
current 'https://your-app.com' example used for clientId with a URL pointing to
the client metadata JSON (e.g., 'https://your-app.com/client-metadata.json') so
the AT Protocol OAuth discovery uses the correct document location.

In `@docs/nuxt.config.ts`:
- Around line 17-21: The config currently sets
content.experimental.sqliteConnector = 'native' which is experimental; either
change that setting to a stable connector (e.g., set
content.experimental.sqliteConnector to 'better-sqlite3' or the equivalent
stable option your framework supports) or add a clear comment/docs entry and
README note next to content.experimental explaining that 'native' relies on
Node's experimental node:sqlite (v22.5.0+) and is intentionally accepted for
this deployment; update any deployment docs to list platform/Node version
constraints and fallback connector guidance.

---

Nitpick comments:
In `@docs/app/components/UInputCopy.vue`:
- Line 40: The aria-label is static; make it dynamic by binding it to the
component's copy state (e.g., replace aria-label="copy button" with
:aria-label="isCopied ? 'copied' : 'copy to clipboard'") and ensure the reactive
flag (e.g., isCopied) is set/cleared in the copy handler (e.g., copyText or
onCopy) so the label updates when the icon switches between copy and check in
UInputCopy.vue.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 23ea0e65-1fd7-4992-b849-b3f58565a3cf

📥 Commits

Reviewing files that changed from the base of the PR and between ceb366b and 8778944.

⛔ Files ignored due to path filters (3)
  • docs/screenshots/documentationPage.png is excluded by !**/*.png
  • docs/screenshots/landingPage.png is excluded by !**/*.png
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (32)
  • docs/app.config.ts
  • docs/app/app.config.ts
  • docs/app/app.vue
  • docs/app/assets/css/main.css
  • docs/app/components/AppFooter.vue
  • docs/app/components/AppHeader.vue
  • docs/app/components/AppLogo.vue
  • docs/app/components/OgImage/AuthUtils.takumi.vue
  • docs/app/components/UInputCopy.vue
  • docs/app/layouts/default.vue
  • docs/app/layouts/docs.vue
  • docs/app/pages/[...slug].vue
  • docs/app/pages/index.vue
  • docs/content.config.ts
  • docs/content/1.getting-started/.navigation.yml
  • docs/content/1.getting-started/1.installation.md
  • docs/content/1.getting-started/2.configuration.md
  • docs/content/2.usage/.navigation.yml
  • docs/content/2.usage/1.session.md
  • docs/content/2.usage/2.oauth.md
  • docs/content/2.usage/3.password-hashing.md
  • docs/content/2.usage/4.webauthn.md
  • docs/content/2.usage/5.atproto.md
  • docs/content/2.usage/6.extend-session.md
  • docs/content/2.usage/7.hybrid-rendering.md
  • docs/content/2.usage/8.websocket.md
  • docs/nuxt.config.ts
  • docs/package.json
  • docs/tsconfig.json
  • package.json
  • playground/app/pages/index.vue
  • pnpm-workspace.yaml

Comment thread docs/app.config.ts
Comment thread docs/app/components/AppFooter.vue
Comment thread docs/app/components/UInputCopy.vue Outdated
Comment thread docs/app/pages/index.vue Outdated
Comment thread docs/content/2.usage/1.session.md Outdated
Comment thread docs/content/2.usage/1.session.md Outdated
Comment thread docs/content/2.usage/4.webauthn.md
Comment thread docs/content/2.usage/5.atproto.md Outdated
Comment thread docs/nuxt.config.ts Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
docs/app/components/AppFooter.vue (1)

20-28: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add rel="noopener noreferrer" to the GitHub button link.

This external target="_blank" link still lacks rel protection.

Suggested fix
       <UButton
         aria-label="Nuxt Auth Utils on GitHub"
         icon="i-simple-icons-github"
         to="https://github.com/atinux/nuxt-auth-utils"
         target="_blank"
+        rel="noopener noreferrer"
         color="neutral"
         variant="ghost"
         size="sm"
       />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/app/components/AppFooter.vue` around lines 20 - 28, The UButton
rendering the external GitHub link (component UButton with aria-label "Nuxt Auth
Utils on GitHub") uses target="_blank" but lacks rel protection; update the
UButton props to include rel="noopener noreferrer" so the anchor generated for
the to="https://github.com/atinux/nuxt-auth-utils" link uses rel="noopener
noreferrer" to prevent tab-napping and leaking window.opener.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/content/2.usage/5.atproto.md`:
- Around line 61-66: Update the atproto docs so the example OAuth metadata URL
is consistent: change the runtimeConfig example value referenced as
runtimeConfig.oauth.bluesky.clientId to match the earlier shown metadata URL
format (i.e., use the metadata document path /bluesky/client-metadata.json
rather than /client-metadata.json), and ensure any other occurrences in this doc
use the identical metadata document URL pattern used in the explanatory
paragraph.

---

Duplicate comments:
In `@docs/app/components/AppFooter.vue`:
- Around line 20-28: The UButton rendering the external GitHub link (component
UButton with aria-label "Nuxt Auth Utils on GitHub") uses target="_blank" but
lacks rel protection; update the UButton props to include rel="noopener
noreferrer" so the anchor generated for the
to="https://github.com/atinux/nuxt-auth-utils" link uses rel="noopener
noreferrer" to prevent tab-napping and leaking window.opener.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 105f4bac-a395-411f-a40b-6f2a73c40f56

📥 Commits

Reviewing files that changed from the base of the PR and between 8778944 and e0346fb.

📒 Files selected for processing (7)
  • docs/app/components/AppFooter.vue
  • docs/app/components/UInputCopy.vue
  • docs/app/pages/index.vue
  • docs/content/2.usage/1.session.md
  • docs/content/2.usage/4.webauthn.md
  • docs/content/2.usage/5.atproto.md
  • docs/nuxt.config.ts
💤 Files with no reviewable changes (1)
  • docs/nuxt.config.ts
✅ Files skipped from review due to trivial changes (2)
  • docs/app/pages/index.vue
  • docs/content/2.usage/4.webauthn.md

Comment thread docs/content/2.usage/5.atproto.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant