Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nuxt): Introduce getAuth() helper #5158

Merged
merged 3 commits into from
Feb 13, 2025

Conversation

wobsoriano
Copy link
Member

Description

This PR introduces a getAuth() helper to our Nuxt SDK similar to our other SDKs (Next.js) that retrieves the current auth state.

Example:

import { getAuth } from '@clerk/nuxt/server';

export default eventHandler((event) => {
  const { userId } = getAuth(event);

  if (!userId) {
    // User is not authenticated
  }
});

Resolves ECO-405

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Copy link

changeset-bot bot commented Feb 13, 2025

🦋 Changeset detected

Latest commit: 6f11075

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/nuxt Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Feb 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2025 8:40pm

@wobsoriano wobsoriano marked this pull request as ready for review February 13, 2025 20:39
@wobsoriano wobsoriano enabled auto-merge (squash) February 13, 2025 21:15
Copy link
Member

@tmilewski tmilewski left a comment

Choose a reason for hiding this comment

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

:shipit:

@wobsoriano wobsoriano merged commit e9c6d79 into main Feb 13, 2025
29 checks passed
@wobsoriano wobsoriano deleted the rob/eco-405-create-getauth-helper-in-nuxt-sdk branch February 13, 2025 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants