🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@bitinflow/nuxt-oauth

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bitinflow/nuxt-oauth

Nuxt 3 OAuth Module

1.0.5
npm
Version published
Weekly downloads
196
201.54%
Maintainers
1
Weekly downloads
 
Created
Source

@bitinflow/nuxt-oauth

Nuxt module for OAuth2 authentication

  • ✨  Release Notes

Features

  • 📦 OAuth2 authentication
  • 📦 Supports only one OAuth2 provider
  • 📦 Supports only implicit flow

Quick Setup

  • Add @bitinflow/nuxt-oauth dependency to your project
# Using pnpm
pnpm add -D @bitinflow/nuxt-oauth

# Using yarn
yarn add --dev @bitinflow/nuxt-oauth

# Using npm
npm install --save-dev @bitinflow/nuxt-oauth
  • Add @bitinflow/nuxt-oauth to the modules section of nuxt.config.ts and disable ssr.

Or alternatively disable ssr via routeRules, only for pages where auth or guest middlewares are needed. Typically account section and login page.

export default defineNuxtConfig({
  modules: [
    '@bitinflow/nuxt-oauth'
  ],

  ssr: false,
  // or
  routeRules: {
    '/account/**': { ssr: false },
    '/auth/**': { ssr: false }
  },

  oauth: {
    redirect: {
      login: '/login',
      logout: '/',
      callback: '/login',
      home: '/home'
    },
    endpoints: {
      authorization: 'https://example.com/v1/oauth/authorization',
      userInfo: `https://example.com/api/users/me`,
      logout: 'https://example.com/oauth/logout'
    },
    clientId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
    scope: ['user:read']
  },
})

That's it! You can now use @bitinflow/nuxt-oauth in your Nuxt app ✨

Development

# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release

FAQs

Package last updated on 08 Apr 2023

Did you know?

Socket

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.

Install

Related posts