Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 6 additions & 39 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/src/content/docs/(core)/contributing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The following steps outline how to set up the local environment.

### Fork the repository

The [Aura Auth repository](https://github.com/aura-stack-js/auth) should be forked by clicking the "Fork" button in the top right corner.
The [Aura Auth repository](https://github.com/aura-stack-ts/auth) should be forked by clicking the "Fork" button in the top right corner.

</Step>

Expand Down
43 changes: 25 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,21 @@
"type-check:packages": "turbo run type-check --parallel --filter=./packages/*",
"create:integration": "node packages/shared/scripts/integration.js"
},
"homepage": "https://github.com/aura-stack-ts/auth#readme",
"bugs": {
"url": "https://github.com/aura-stack-ts/auth/issues",
"email": "aurastackjs@gmail.com"
},
"license": "MIT",
"author": "Aura Stack <aurastackjs@gmail.com> | Hernan Alvarado <halvaradop.dev@gmail.com>",
"repository": {
"type": "git",
"url": "git+https://github.com/aura-stack-js/auth.git"
"url": "git+https://github.com/aura-stack-ts/auth.git"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/halvaradop"
},
"bugs": "https://github.com/aura-stack-js/auth/issues",
"homepage": "https://github.com/aura-stack-js/auth#readme",
"keywords": [
"authentication",
"auth",
Expand All @@ -36,17 +45,6 @@
"openid connect",
"oidc"
],
"author": "Aura Stack <aurastackjs@gmail.com> | Hernan Alvarado <halvaradop.dev@gmail.com>",
"license": "MIT",
"devDependencies": {
"@types/node": "catalog:node",
"@vitest/coverage-v8": "catalog:vitest",
"tsdown": "^0.21.10",
"turbo": "^2.9.18",
"typescript": "catalog:typescript",
"vitest": "catalog:vitest"
},
"packageManager": "pnpm@10.15.0",
"workspaces": {
"packages": [
"packages/*",
Expand Down Expand Up @@ -116,6 +114,18 @@
}
}
},
"dependencies": {
"oxfmt": "^0.51.0",
"oxlint": "^1.69.0"
},
"devDependencies": {
"@types/node": "catalog:node",
"@vitest/coverage-v8": "catalog:vitest",
"tsdown": "^0.21.10",
"turbo": "^2.9.18",
"typescript": "catalog:typescript",
"vitest": "catalog:vitest"
},
"overrides": {
"dompurify": "^3.4.0",
"file-type": "^21.3.2",
Expand All @@ -131,11 +141,8 @@
"uuid": "^11.1.1",
"qs": "^6.15.2"
},
"packageManager": "pnpm@10.15.0",
"engines": {
"node": ">=22"
},
"dependencies": {
"oxfmt": "^0.51.0",
"oxlint": "^1.69.0"
}
}
85 changes: 45 additions & 40 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,21 @@
"clean:cts": "[ -d dist ] && find dist -type f -name \"*.cts\" -delete || true",
"prepublishOnly": "pnpm build && pnpm clean:cts"
},
"homepage": "https://aura-stack-auth.vercel.app",
"bugs": {
"url": "https://github.com/aura-stack-ts/auth/issues",
"email": "aurastackjs@gmail.com"
},
"license": "MIT",
"author": "Aura Stack <aurastackjs@gmail.com> | Hernan Alvarado <halvaradop.dev@gmail.com>",
"repository": {
"type": "git",
"url": "git+https://github.com/aura-stack-ts/auth"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/halvaradop"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/@aura-stack/auth"
Expand All @@ -31,6 +42,40 @@
"files": [
"dist"
],
"keywords": [
"auth",
"oauth",
"oauth2",
"security",
"session",
"authentication",
"authorization",
"typescript",
"javascript",
"node",
"bun",
"deno",
"edge",
"aura stack",
"aura-stack",
"aura-stack-ts",
"aura stack ts"
],
"dependencies": {
"@aura-stack/jose": "workspace:*",
"@aura-stack/rate-limiter": "workspace:*",
"@aura-stack/router": "^0.9.0",
"arktype": "^2.2.0",
"typebox": "^1.1.38",
"valibot": "catalog:valibot",
"zod": "catalog:zod-v4"
},
"devDependencies": {
"@aura-stack/tsconfig": "workspace:*",
"@aura-stack/tsdown-config": "workspace:*",
"typescript": "catalog:typescript",
"vitest": "catalog:vitest"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -82,45 +127,5 @@
"import": "./dist/shared/cookies.js",
"require": "./dist/shared/cookies.cjs"
}
},
"keywords": [
"auth",
"oauth",
"oauth2",
"security",
"session",
"authentication",
"authorization",
"typescript",
"javascript",
"node",
"bun",
"deno",
"edge",
"aura-stack",
"aura-stack-ts",
"aura auth",
"aura-auth"
],
"author": "Aura Stack <aurastackjs@gmail.com> | Hernan Alvarado <halvaradop.dev@gmail.com>",
"homepage": "https://aura-stack-auth.vercel.app",
"bugs": {
"url": "https://github.com/aura-stack-ts/auth/issues"
},
"license": "MIT",
"dependencies": {
"@aura-stack/jose": "workspace:*",
"@aura-stack/rate-limiter": "workspace:*",
"@aura-stack/router": "^0.9.0",
"arktype": "^2.2.0",
"typebox": "^1.1.38",
"valibot": "catalog:valibot",
"zod": "catalog:zod-v4"
},
"devDependencies": {
"@aura-stack/tsconfig": "workspace:*",
"@aura-stack/tsdown-config": "workspace:*",
"typescript": "catalog:typescript",
"vitest": "catalog:vitest"
}
}
1 change: 0 additions & 1 deletion packages/core/src/api/refreshUserInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export const refreshUserInfo = async <DefaultUser extends User = User>(
},
} as RefreshUserInfoAPIReturn<DefaultUser>
} catch (error) {
console.warn("Error refreshing user info:", error)
const { code, message, statusCode } = handleApiError(
error,
"UNKNOWN_REFRESH_USER_INFO_ERROR",
Expand Down
5 changes: 1 addition & 4 deletions packages/core/src/router/errorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import type { InternalLogger } from "@/@types/index.ts"

export const createErrorHandler = (logger?: InternalLogger): RouterConfig["onError"] => {
return (error) => {
if (isAuraRouterError(error) || isAuraRouterValidationError(error)) {
return error.toResponse()
}
if (isAuraAuthError(error)) {
if (isAuraRouterError(error) || isAuraRouterValidationError(error) || isAuraAuthError(error)) {
return error.toResponse()
}
logger?.log("SERVER_ERROR", { structuredData: { error_type: error.name, error_message: error.message } })
Expand Down
56 changes: 41 additions & 15 deletions packages/device/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,55 @@
"clean:cts": "[ -d dist ] && find dist -type f -name \"*.cts\" -delete || true",
"prepublishOnly": "pnpm clean:cts && pnpm build && pnpm clean:cts"
},
"homepage": "https://aura-stack-auth.vercel.app",
"bugs": {
"url": "https://github.com/aura-stack-ts/auth/issues",
"email": "aurastackjs@gmail.com"
},
"license": "MIT",
"author": "Aura Stack <aurastackjs@gmail.com> | Hernan Alvarado <halvaradop.dev@gmail.com>",
"repository": {
"type": "git",
"url": "git+https://github.com/aura-stack-ts/auth"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/halvaradop"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/@aura-stack/device"
},
Comment on lines +36 to +39

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== candidate package.json files =="
for f in packages/device/package.json packages/next/package.json packages/rate-limiter/package.json packages/react-router/package.json packages/react/package.json; do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    sed -n '1,80p' "$f" | grep -n -A4 -B2 'publishConfig\|registry' || true
  else
    echo "MISSING $f"
  fi
done

echo
echo "== references to NPM_REGISTRY / registry settings =="
rg -n "NPM_REGISTRY|registry\.npmjs\.org|publishConfig|npm_package_publish" -S . --glob '!node_modules' --glob '!dist' --glob '!build' || true

Repository: aura-stack-ts/auth

Length of output: 3311


🌐 Web query:

npm publishConfig registry package.json registry base URL documentation

💡 Result:

In npm, the publishConfig field in package.json is a dictionary of configuration values that are applied specifically at publish-time [1][2]. This allows you to override default registry settings to ensure a package is published to a specific destination, such as an internal or private registry [1][2]. To specify a registry, you add the registry key within the publishConfig object in your package.json file [3][1]: "publishConfig": { "registry": "https://registry.example.com/" } For scoped packages, you can also define a registry for a specific scope by using the scope name as the key, formatted with a colon separator [4]: "publishConfig": { "@my-scope:registry": "https://registry.example.com/" } Key points regarding the registry configuration: - Purpose: It ensures that a package is not accidentally published to the global public registry when you intend for it to go to a private or internal registry [1][2]. - Precedence: publishConfig settings are applied only when the npm publish command is executed [1][5]. - Scope-specific configuration: Using the @scope:registry syntax allows for granular control, which is particularly useful in environments where different scopes must point to different registry endpoints [4]. For more comprehensive information on available configuration options that can be overridden via publishConfig, refer to the official npm documentation on configuration [1][5].

Citations:


Use the npm registry base URL in every package manifest.

publishConfig.registry overrides npm registry configuration, and it should be a registry base URL. Package-specific URLs such as https://registry.npmjs.org/@aura-stack/device are invalid publish targets and can break publishing. Set this to https://registry.npmjs.org/ across the scopes.

  • packages/device/package.json#L36-L39
  • packages/next/package.json#L38-L41
  • packages/rate-limiter/package.json#L37-L39
  • packages/react-router/package.json#L38-L41
  • packages/react/package.json#L38-L41
📍 Affects 5 files
  • packages/device/package.json#L36-L39 (this comment)
  • packages/next/package.json#L38-L41
  • packages/rate-limiter/package.json#L37-L39
  • packages/react-router/package.json#L38-L41
  • packages/react/package.json#L38-L41
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/device/package.json` around lines 36 - 39, Update
publishConfig.registry to the npm registry base URL https://registry.npmjs.org/
in packages/device/package.json (lines 36-39), packages/next/package.json (lines
38-41), packages/rate-limiter/package.json (lines 37-39),
packages/react-router/package.json (lines 38-41), and
packages/react/package.json (lines 38-41), removing each package-specific path
while preserving the existing public access setting.

"sideEffects": false,
"files": [
"dist"
],
"keywords": [
"auth",
"oauth",
"oauth2",
"security",
"session",
"authentication",
"authorization",
"typescript",
"javascript",
"device authorization grant",
"device flow",
"device grant",
"device code",
"aura stack",
"aura-stack",
"aura-stack-ts",
"aura stack ts"
],
"dependencies": {
"valibot": "catalog:valibot"
},
"devDependencies": {
"@aura-stack/tsconfig": "workspace:*",
"@aura-stack/tsdown-config": "workspace:*"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
Expand All @@ -43,20 +84,5 @@
"require": "./dist/providers/*.cjs"
}
},
"keywords": [],
"author": "Aura Stack <aurastackjs@gmail.com> | Hernan Alvarado <halvaradop.dev@gmail.com>",
"homepage": "https://aura-stack-auth.vercel.app",
"bugs": {
"url": "https://github.com/aura-stack-ts/auth/issues"
},
"license": "MIT",
"dependencies": {
"valibot": "catalog:valibot"
},
"devDependencies": {
"@aura-stack/tsconfig": "workspace:*",
"@aura-stack/tsdown-config": "workspace:*"
},
"peerDependencies": {},
"packageManager": "pnpm@10.15.0"
}
Loading
Loading