Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammadM1998 authored Feb 23, 2024
2 parents 8666301 + 457cb50 commit 8fcb3b1
Show file tree
Hide file tree
Showing 37 changed files with 4,941 additions and 2,661 deletions.
33 changes: 33 additions & 0 deletions .github/DISCUSSION_TEMPLATE/feature-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "🚀 Feature request"
description: Suggest a feature that will improve NuxtAuth
labels: ["pending", "enchantment"]
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to fill out this feature request!
- type: textarea
id: feature-description
attributes:
label: Describe the feature
description: A clear and concise description of what you think would be a helpful addition to NuxtAuth, including the possible use cases and alternatives you have considered. If you have a working prototype or module that implements it, please include a link.
placeholder: Feature description
validations:
required: true
- type: checkboxes
id: provider
attributes:
label: Which provider would this enchantment improve?
description: We currently offer three providers: authjs, local and refresh. If the enchanment is a general one, please select all three.
options:
- label: AuthJS
- label: Local
- label: Refresh
- label: New Provider
- type: checkboxes
id: additional-info
attributes:
label: Additional information
description: Additional information that helps us decide how to proceed.
options:
- label: Would you be willing to help implement this feature?
17 changes: 13 additions & 4 deletions .github/ISSUE_TEMPLATE/bug-report.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
name: 🐞 Bug report
description: Create a bug report for this project
labels: [bug]
labels: [bug, pending]
body:
- type: markdown
attributes:
value: |
Please help us finding and resolving problems.
Please carefully read the nuxt contribution docs before creating a bug report
👉 https://nuxt.com/docs/community/reporting-bugs
Please use a template below to create a minimal reproduction
👉 https://stackblitz.com/github/nuxt/starter/tree/v3
👉 https://codesandbox.io/s/github/nuxt/starter/tree/v3
- type: textarea
id: bug-env
attributes:
label: Environment
description: You can use `npx nuxi info` to fill this section
placeholder: Environment
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Reproduction
description: Provide a link to a repo that can reproduce the problem you ran into if you can.
description: Please provide a link to a repo that can reproduce the problem you ran into. A [**minimal reproduction**](https://nuxt.com/docs/community/reporting-bugs#create-a-minimal-reproduction) is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided we might close it.
placeholder: Reproduction
validations:
required: true
- type: textarea
id: bug-description
attributes:
Expand All @@ -37,4 +46,4 @@ body:
label: Logs
description: |
Optional if provided reproduction. Please try not to insert an image but copy paste the log text.
render: shell
render: shell-script
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
blank_issues_enabled: true
blank_issues_enabled: false
contact_links:
- name: 📚 nuxt-auth documentation
url: https://sidebase.io/nuxt-auth
about: Check the documentation for usage of nuxt-auth
- name: 💬 Discussions
url: https://github.com/sidebase/nuxt-auth/discussions
about: Use discussions if you have another issue, an idea for improvement or for asking questions.
- name: 🚀 Feature request
url: https://github.com/sidebase/nuxt-auth/discussions/new?category=feature-requests
about: Suggest a feature to improve this project
22 changes: 0 additions & 22 deletions .github/ISSUE_TEMPLATE/feature-request.yaml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!---
☝️ PR title should follow conventional commits (https://conventionalcommits.org)
Please carefully read the contribution docs before creating a pull request
👉 https://nuxt.com/docs/community/contribution
-->

### 🔗 Linked issue

<!-- Please ensure there is an open issue and mention its number as #123 -->

### ❓ Type of change

<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. -->

- [ ] 📖 Documentation (updates to the documentation, readme or JSdoc annotations)
- [ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
- [ ] 👌 Enhancement (improving an existing functionality like performance)
- [ ] ✨ New feature (a non-breaking change that adds functionality)
- [ ] 🧹 Chore (updates to the build process or auxiliary tools and libraries)
- [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

### 📚 Description

<!-- Describe your changes in detail -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If it resolves an open issue, please link to the issue here. For example "Resolves #1337" -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] I have linked an issue or discussion.
- [ ] I have added tests (if possible).
- [ ] I have updated the documentation accordingly.
19 changes: 11 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ on:
pull_request:
branches: [main]

env:
NODE_VER: 18.19.1

jobs:
test-module:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js 16.14.2
- name: Use Node.js ${{ env.NODE_VER }}
uses: actions/setup-node@v3
with:
node-version: 16.14.2
node-version: ${{ env.NODE_VER }}

- uses: pnpm/action-setup@v2
name: Install pnpm
Expand Down Expand Up @@ -47,10 +50,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use Node.js 16.14.2
- name: Use Node.js ${{ env.NODE_VER }}
uses: actions/setup-node@v3
with:
node-version: 16.14.2
node-version: ${{ env.NODE_VER }}

- uses: pnpm/action-setup@v2
name: Install pnpm
Expand All @@ -75,10 +78,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use Node.js 16.14.2
- name: Use Node.js ${{ env.NODE_VER }}
uses: actions/setup-node@v3
with:
node-version: 16.14.2
node-version: ${{ env.NODE_VER }}

- uses: pnpm/action-setup@v2
name: Install pnpm
Expand Down Expand Up @@ -106,10 +109,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use Node.js 16.14.2
- name: Use Node.js ${{ env.NODE_VER }}
uses: actions/setup-node@v3
with:
node-version: 16.14.2
node-version: ${{ env.NODE_VER }}

- uses: pnpm/action-setup@v2
name: Install pnpm
Expand Down
37 changes: 18 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,37 @@
"dist"
],
"scripts": {
"prepack": "nuxt-module-build",
"prepack": "nuxt-module-build build",
"build": "nuxi build",
"lint": "eslint . --max-warnings=0",
"clean": "rm -rf playground-authjs/.nuxt playground-local/.nuxt playground-refresh/.nuxt dist .nuxt",
"typecheck": "nuxi prepare playground-local && tsc --noEmit",
"typecheck:refresh": "nuxi prepare playground-refresh && tsc --noEmit",
"dev:prepare": "nuxt-module-build --stub"
"dev:prepare": "nuxt-module-build build --stub"
},
"dependencies": {
"@nuxt/kit": "^3.4.2",
"@vueuse/core": "^9.13.0",
"defu": "^6.1.2",
"h3": "^1.6.4",
"@nuxt/kit": "^3.10.2",
"defu": "^6.1.4",
"h3": "^1.10.1",
"knitwork": "^1.0.0",
"nitropack": "^2.3.2",
"nitropack": "^2.8.1",
"requrl": "^3.0.2",
"ufo": "^1.1.1"
"ufo": "^1.4.0"
},
"peerDependencies": {
"next-auth": "^4.21.1"
"next-auth": "~4.21.1"
},
"devDependencies": {
"@nuxt/module-builder": "^0.3.0",
"@nuxt/schema": "^3.4.2",
"@nuxtjs/eslint-config-typescript": "^12.0.0",
"@types/node": "^18.15.11",
"eslint": "^8.37.0",
"nuxt": "^3.4.2",
"ofetch": "^1.0.1",
"ts-essentials": "^9.3.1",
"typescript": "^5.0.3",
"vue-tsc": "^1.2.0"
"@nuxt/module-builder": "^0.5.5",
"@nuxt/schema": "^3.10.2",
"@nuxtjs/eslint-config-typescript": "^12.1.0",
"@types/node": "^18.19.14",
"eslint": "^8.56.0",
"nuxt": "^3.10.2",
"ofetch": "^1.3.3",
"ts-essentials": "^9.4.1",
"typescript": "^5.3.3",
"vue-tsc": "^1.8.27"
},
"overrides": {
"@nuxt/kit": {
Expand Down
8 changes: 4 additions & 4 deletions playground-authjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"postinstall": "nuxt prepare"
},
"devDependencies": {
"eslint": "^8.37.0",
"nuxt": "^3.4.2",
"typescript": "^5.0.3",
"vue-tsc": "^1.2.0"
"eslint": "^8.56.0",
"nuxt": "^3.10.1",
"typescript": "^5.3.3",
"vue-tsc": "^1.8.27"
}
}
1 change: 1 addition & 0 deletions playground-authjs/server/api/protected/inline.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { eventHandler } from 'h3'
import { getServerSession } from '#auth'

export default eventHandler(async (event) => {
Expand Down
2 changes: 2 additions & 0 deletions playground-authjs/server/api/protected/middleware.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
import { eventHandler } from 'h3'

export default eventHandler(() => ({ status: 'authenticated', text: 'you only see me if you are logged in, as a server-middleware protects me' }))
1 change: 1 addition & 0 deletions playground-authjs/server/api/token.get.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { eventHandler } from 'h3'
import { getToken } from '#auth'

export default eventHandler(event => getToken({ event }))
1 change: 1 addition & 0 deletions playground-authjs/server/middleware/auth.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { createError, eventHandler } from 'h3'
import { getServerSession } from '#auth'

export default eventHandler(async (event) => {
Expand Down
14 changes: 7 additions & 7 deletions playground-local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"postinstall": "nuxt prepare"
},
"dependencies": {
"jsonwebtoken": "^9.0.0",
"zod": "^3.21.4"
"jsonwebtoken": "^9.0.2",
"zod": "^3.22.4"
},
"devDependencies": {
"@types/jsonwebtoken": "^9.0.1",
"eslint": "^8.37.0",
"nuxt": "^3.4.2",
"typescript": "^5.0.3",
"vue-tsc": "^1.2.0"
"@types/jsonwebtoken": "^9.0.5",
"eslint": "^8.56.0",
"nuxt": "^3.10.1",
"typescript": "^5.3.3",
"vue-tsc": "^1.8.27"
}
}
3 changes: 2 additions & 1 deletion playground-local/server/api/auth/login.post.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import z from 'zod'
import { createError, eventHandler, readBody } from 'h3'
import { z } from 'zod'
import { sign } from 'jsonwebtoken'

const refreshTokens: Record<number, Record<string, any>> = {}
Expand Down
2 changes: 2 additions & 0 deletions playground-local/server/api/auth/logout.post.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
import { eventHandler } from 'h3'

export default eventHandler(() => ({ status: 'OK ' }))
2 changes: 1 addition & 1 deletion playground-local/server/api/auth/user.get.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { H3Event } from 'h3'
import { createError, eventHandler, getRequestHeader, H3Event } from 'h3'
import { verify } from 'jsonwebtoken'
import { SECRET } from './login.post'

Expand Down
14 changes: 7 additions & 7 deletions playground-refresh/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"postinstall": "nuxt prepare"
},
"dependencies": {
"jsonwebtoken": "^9.0.0",
"zod": "^3.21.4"
"jsonwebtoken": "^9.0.2",
"zod": "^3.22.4"
},
"devDependencies": {
"@types/jsonwebtoken": "^9.0.1",
"eslint": "^8.37.0",
"nuxt": "^3.4.2",
"typescript": "^5.0.3",
"vue-tsc": "^1.2.0"
"@types/jsonwebtoken": "^9.0.5",
"eslint": "^8.56.0",
"nuxt": "^3.10.1",
"typescript": "^5.3.3",
"vue-tsc": "^1.8.27"
}
}
3 changes: 2 additions & 1 deletion playground-refresh/server/api/auth/login.post.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import z from 'zod'
import { createError, eventHandler, readBody } from 'h3'
import { z } from 'zod'
import { sign } from 'jsonwebtoken'

export const SECRET = 'dummy'
Expand Down
4 changes: 3 additions & 1 deletion playground-refresh/server/api/auth/logout.post.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export default eventHandler(() => ({ status: 'OK ' }))
import { eventHandler } from 'h3'

export default eventHandler(() => ({ status: 'OK' }))
1 change: 1 addition & 0 deletions playground-refresh/server/api/auth/refresh.post.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { createError, eventHandler, readBody } from 'h3'
import { sign, verify } from 'jsonwebtoken'

export const SECRET = 'dummy'
Expand Down
2 changes: 1 addition & 1 deletion playground-refresh/server/api/auth/user.get.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { H3Event } from 'h3'
import { createError, eventHandler, getRequestHeader, H3Event } from 'h3'
import { verify } from 'jsonwebtoken'
import { SECRET } from './login.post'

Expand Down
Loading

0 comments on commit 8fcb3b1

Please sign in to comment.