Skip to content

Commit

Permalink
feat(#673): migrate to AuthJS (#818)
Browse files Browse the repository at this point in the history
Co-authored-by: Zoey <[email protected]>
  • Loading branch information
phoenix-ru and zoey-kaiser authored Jul 25, 2024
1 parent f29d677 commit 8d6538d
Show file tree
Hide file tree
Showing 33 changed files with 9,125 additions and 7,267 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
branches: [main, next]

env:
NODE_VER: 18.19.1
NODE_VER: 22.3.0
PNPM_VER: 9.4.0
CI: true

jobs:
Expand All @@ -26,7 +27,7 @@ jobs:
name: Install pnpm
id: pnpm-install
with:
version: 8
version: ${{ env.PNPM_VER }}

# Install deps and prepare types
- run: pnpm i
Expand Down Expand Up @@ -57,7 +58,7 @@ jobs:
name: Install pnpm
id: pnpm-install
with:
version: 8
version: ${{ env.PNPM_VER }}

# Install deps and prepare types
- run: pnpm i
Expand All @@ -84,7 +85,7 @@ jobs:
name: Install pnpm
id: pnpm-install
with:
version: 8
version: ${{ env.PNPM_VER }}

# Install deps
- run: pnpm i
Expand Down Expand Up @@ -115,7 +116,7 @@ jobs:
name: Install pnpm
id: pnpm-install
with:
version: 8
version: ${{ env.PNPM_VER }}

# Install deps
- run: pnpm i
Expand Down Expand Up @@ -146,7 +147,7 @@ jobs:
name: Install pnpm
id: pnpm-install
with:
version: 8
version: ${{ env.PNPM_VER }}

# Install deps
- run: pnpm i
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
NODE_VER: 22.3.0
PNPM_VER: 9.4.0

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
Expand All @@ -31,11 +35,11 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: Setup Node
version: ${{ env.PNPM_VER }}
- name: Use Node.js ${{ env.NODE_VER }}
uses: actions/setup-node@v4
with:
node-version: 20
node-version: ${{ env.NODE_VER }}
cache: pnpm
- name: Setup Pages
uses: actions/configure-pages@v4
Expand Down
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
shamefully-hoist=true
strict-peer-dependencies=false
ignore-workspace-root-check=true
link-workspace-packages=true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Then visit the [Quick Start documentation](https://auth.sidebase.io/guide/gettin
## Features

`@sidebase/nuxt-auth` is a library with the goal of supporting authentication for any universal Nuxt 3 application. At the moment three providers are supported:
- [`authjs`](https://auth.sidebase.io/guide/authjs/quick-start): for non-static apps that want to use [Auth.js / NextAuth.js](https://github.com/nextauthjs/next-auth) to offer the reliability & convenience of a 23k star library to the Nuxt 3 ecosystem with a native developer experience (DX)
- [`authjs`](https://auth.sidebase.io/guide/authjs/quick-start): for non-static apps that want to use [Auth.js](https://authjs.dev/) to offer the reliability & convenience of a 23k star library to the Nuxt 3 ecosystem with a native developer experience (DX)
- [`local`](https://auth.sidebase.io/guide/local/quick-start): for static pages that rely on an external backend with a credential flow for authentication.
- [`refresh`](https://auth.sidebase.io/guide/local/quick-start#refresh-token): for static pages that rely on an external backend with a credential flow and refresh tokens for authentication.

Expand Down
10 changes: 9 additions & 1 deletion docs/.vitepress/routes/navbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export const routes: DefaultTheme.Config['nav'] = [
text: 'Overview',
link: '/resources/overview',
},
{
text: 'Migrations',
link: '/resources/migrations/1.0.0',
},
{
text: 'Security',
link: '/resources/security',
Expand All @@ -38,8 +42,12 @@ export const routes: DefaultTheme.Config['nav'] = [
],
},
{
text: '0.8.0',
text: '1.0.0',
items: [
{
text: '0.8.1',
link: 'https://github.com/sidebase/nuxt-auth/tree/0.8.1/docs',
},
{
text: '0.7.2',
link: 'https://github.com/sidebase/nuxt-auth/tree/0.7.2/docs/content',
Expand Down
218 changes: 119 additions & 99 deletions docs/.vitepress/routes/sidebar.ts
Original file line number Diff line number Diff line change
@@ -1,103 +1,123 @@
import type { DefaultTheme } from 'vitepress'

const guideSidebar: DefaultTheme.SidebarItem[] = [
{
text: 'Getting started',
base: '/guide/getting-started',
items: [
{
text: 'Introduction',
link: '/introduction',
},
{
text: 'Installation',
link: '/installation',
},
{
text: 'Choosing the provider',
link: '/choose-provider',
},
],
},
{
text: 'Application side',
base: '/guide/application-side',
items: [
{
text: 'Configuration',
link: '/configuration',
},
{
text: 'Session access',
link: '/session-access',
},
{
text: 'Protecting pages',
link: '/protecting-pages',
},
],
},
{
text: 'AuthJS Provider',
base: '/guide/authjs',
items: [
{
text: 'Quick Start',
link: '/quick-start',
},
{
text: 'NuxtAuthHandler',
link: '/nuxt-auth-handler',
},
{
text: 'Custom pages',
link: '/custom-pages',
},
{
text: 'Session data',
link: '/session-data',
},
{
text: 'Server side',
collapsed: true,
items: [
{ text: 'Session access', link: '/server-side/session-access' },
{ text: 'JWT access', link: '/server-side/jwt-access' },
{ text: 'Rest API', link: '/server-side/rest-api' },
],
},
],
},
{
text: 'Local / Refresh Provider',
base: '/guide/local',
items: [
{
text: 'Quick Start',
link: '/quick-start',
},
{
text: 'Session data',
link: '/session-data',
}
],
},
{
text: 'Advanced',
base: '/guide/advanced',
items: [
{
text: 'Deployment',
collapsed: true,
items: [
{ text: 'Self-hosted', link: '/deployment/self-hosted' },
{ text: 'Vercel', link: '/deployment/vercel' },
{ text: 'Netlify', link: '/deployment/netlify' },
],
},
{ text: 'Caching', link: '/caching' },
],
},
]

const migrationsSidebar: DefaultTheme.SidebarItem[] = [
{
text: 'Migrations',
base: '/resources/migrations',
items: [
{
text: 'Upgrading to v1.0.0',
link: '/1.0.0',
},
{
text: 'Upgrading to v0.8.0',
link: '/0.8.0',
},
],
},
]

export const routes: DefaultTheme.Config['sidebar'] = {
'/guide': [
{
text: 'Getting started',
base: '/guide/getting-started',
items: [
{
text: 'Introduction',
link: '/introduction',
},
{
text: 'Installation',
link: '/installation',
},
{
text: 'Choosing the provider',
link: '/choose-provider',
},
],
},
{
text: 'Application side',
base: '/guide/application-side',
items: [
{
text: 'Configuration',
link: '/configuration',
},
{
text: 'Session access',
link: '/session-access',
},
{
text: 'Protecting pages',
link: '/protecting-pages',
},
],
},
{
text: 'AuthJS Provider',
base: '/guide/authjs',
items: [
{
text: 'Quick Start',
link: '/quick-start',
},
{
text: 'NuxtAuthHandler',
link: '/nuxt-auth-handler',
},
{
text: 'Custom pages',
link: '/custom-pages',
},
{
text: 'Session data',
link: '/session-data',
},
{
text: 'Server side',
collapsed: true,
items: [
{ text: 'Session access', link: '/server-side/session-access' },
{ text: 'JWT access', link: '/server-side/jwt-access' },
{ text: 'Rest API', link: '/server-side/rest-api' },
],
},
],
},
{
text: 'Local / Refresh Provider',
base: '/guide/local',
items: [
{
text: 'Quick Start',
link: '/quick-start',
},
{
text: 'Session data',
link: '/session-data',
}
],
},
{
text: 'Advanced',
base: '/guide/advanced',
items: [
{
text: 'Deployment',
collapsed: true,
items: [
{ text: 'Self-hosted', link: '/deployment/self-hosted' },
{ text: 'Vercel', link: '/deployment/vercel' },
{ text: 'Netlify', link: '/deployment/netlify' },
],
},
{ text: 'Caching', link: '/caching' },
],
},
],
'/guide': guideSidebar,
'/resources/migrations': migrationsSidebar
}
6 changes: 3 additions & 3 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import Banner from './components/Banner.vue'
// Configuration
const bannerConfig = {
// Leave text empty to disable the banner
text: 'NuxtAuth v0.8.0 has been released! ✨',
text: '⚠️ You are viewing the docs for NuxtAuth v1.0.0 ⚠️',
button: {
href: 'https://github.com/sidebase/nuxt-auth/releases/tag/0.8.0',
text: 'View release notes'
href: '/resources/migrations/1.0.0',
text: 'View migration guide'
}
}

Expand Down
Loading

0 comments on commit 8d6538d

Please sign in to comment.