
Security News
npm βisβ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
@sidebase/nuxt-auth
Advanced tools
nuxt-auth
is a feature-packed, open-source authentication module for Nuxt 3 applications. Starting with v0.6nuxt-auth
also supports static Nuxt applications
npm i -D @sidebase/nuxt-auth
Then visit the Quick Start documentation to setup the module for <= v0.5 - the current stable version.
Visit the Quick Start documentation to setup the module for >= v0.6 - the "future" experimental version with support for static Nuxt 3 apps and the local
provider.
nuxt-auth
is a library with the goal of supporting authentication for any universal Nuxt 3 application. At the moment two providers are supported:
local
for static pages that rely on an external backend with a credential flow for authentication. local
is supported starting with v0.6 of the moduleFeatures of the authjs
-provider of nuxt-auth
include:
useAuth
supports:
getSession
, getCsrfToken
, getProviders
, signIn
, signOut
status
, data
, lastRefreshedAt
GET /signin
,POST /signin/:provider
,GET/POST /callback/:provider
,GET /signout
,POST /signout
,GET /session
,GET /csrf
,GET /providers
You can find a feature-table of all starting with v0.6 in the nuxt-auth "next"-version-docs.
Visit the nuxt-auth
demo page here:
You can find the demo source-code here.
This project uses pnpm
for development.
pnpm dev:prepare
to generate type stubs.pnpm dev
to start the module playground in development mode.pnpm lint
to run eslintpnpm typecheck
to run typescheck via tscpnpm publish --access public
to publish (bump version before)This module also has it's own playground:
> git clone https://github.com/sidebase/nuxt-auth
> cd nuxt-auth
# **OPEN THE `~/playground/server/api/auth/[...].ts` and configure your own auth-provider
> pnpm i
> pnpm dev:prepare
> pnpm dev
# -> open http://localhost:3000
We have one playground per provider:
How to test static Nuxt 3 apps?
To test static Nuxt 3 apps we want to run a static frontend and a separate backend that will take over authentication:
playground-local/nuxt.config.ts
: Add baseURL: 'http://localhost:3001'
to the auth
-configcd playground-local
pnpm generate
pnpm start
cd playground-local
pnpm dev
# A seconds Nuxt app should now be running on http://localhost:3001. We use this purely for authentication
3001
FAQs
Authentication built for Nuxt 3! Easily add authentication via OAuth providers, credentials or Email Magic URLs!
The npm package @sidebase/nuxt-auth receives a total of 21,792 weekly downloads. As such, @sidebase/nuxt-auth popularity was classified as popular.
We found that @sidebase/nuxt-auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.