Compare commits

..

7 Commits

Author SHA1 Message Date
Balázs Orbán
b57dea40e2 chore: don't run build before tests 2022-12-23 03:09:39 +01:00
Balázs Orbán
1387445600 chore: more formatting 2022-12-23 03:03:52 +01:00
Balázs Orbán
b2d7f5529f chore: format 2022-12-23 03:02:26 +01:00
Balázs Orbán
7c101f5a73 chore: add auth packages as docs dependency 2022-12-23 02:56:02 +01:00
Balázs Orbán
92c96a267f chore: format 2022-12-23 02:50:00 +01:00
Balázs Orbán
b31bad15fe feat(sveltekit): update to use latest @auth/core 2022-12-23 02:38:36 +01:00
Balázs Orbán
d225bbe600 docs(sveltekit): autogenerate API reference 2022-12-23 02:37:43 +01:00
7 changed files with 86 additions and 29 deletions

View File

@@ -50,7 +50,6 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT_CLASSIC }}
- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
with:
@@ -65,10 +64,10 @@ jobs:
- name: Publish to npm and GitHub
run: pnpm release
env:
# Use GH_PAT when this is fixed:
# https://github.com/github/roadmap/issues/622
GITHUB_TOKEN: ${{ secrets.GH_PAT_CLASSIC }}
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NO_VERFIY: 1
DRY_RUN: 1
release-pr:
name: Publish PR
runs-on: ubuntu-latest

View File

@@ -68,7 +68,7 @@
"value": "sveltekit.authjs.dev"
}
],
"destination": "https://authjs.dev/reference/sveltekit/modules/main"
"destination": "https://authjs.dev/reference/sveltekit/"
},
{
"source": "/:path(.*)",

View File

@@ -8,7 +8,7 @@
"build": "turbo run build --filter=next-auth --filter=@next-auth/* --filter=@auth/* --no-deps",
"lint": "turbo run lint --parallel",
"format": "turbo run format --parallel",
"test": "turbo run test --concurrency=1 --filter=[HEAD^1] --filter=./packages/* --filter=!*pouchdb-* --filter=!@*upstash* --filter=!*dynamodb-*",
"test": "turbo run test --concurrency=1 --filter=[HEAD^1] --filter=./packages/* --filter=!*pouchdb-* --filter=!@*upstash*",
"clean": "turbo run clean --no-cache",
"dev:db": "turbo run dev --parallel --continue --filter=next-auth-app...",
"dev": "turbo run dev --parallel --continue --filter=next-auth-app... --filter=!./packages/adapter-*",
@@ -20,7 +20,7 @@
},
"devDependencies": {
"@actions/core": "^1.6.0",
"@balazsorban/monorepo-release": "0.1.7",
"@balazsorban/monorepo-release": "0.1.1",
"@types/jest": "^28.1.3",
"@types/node": "^17.0.25",
"@typescript-eslint/eslint-plugin": "^5.10.2",

View File

@@ -1,6 +1,6 @@
{
"name": "@auth/core",
"version": "0.2.1",
"version": "0.1.4",
"description": "Authentication for the web.",
"homepage": "https://authjs.dev",
"repository": "https://github.com/nextauthjs/next-auth.git",
@@ -83,4 +83,4 @@
"postcss": "8.4.19",
"postcss-nested": "6.0.0"
}
}
}

View File

@@ -158,6 +158,7 @@ export async function Auth(
*
* const request = new Request("https://example.com")
* const resposne = await AuthHandler(request, authConfig)
*
* ```
*
* @see [Initiailzation](https://authjs.dev/reference/configuration/auth-options)
@@ -167,8 +168,10 @@ export interface AuthConfig {
* List of authentication providers for signing in
* (e.g. Google, Facebook, Twitter, GitHub, Email, etc) in any order.
* This can be one of the built-in providers or an object with a custom provider.
* * **Default value**: `[]`
* * **Required**: *Yes*
*
* @default []
* [Documentation](https://next-auth.js.org/configuration/options#providers) | [Providers documentation](https://next-auth.js.org/configuration/providers)
*/
providers: Provider[]
/**
@@ -178,23 +181,36 @@ export interface AuthConfig {
*
* On Unix systems: `openssl rand -hex 32`
* Or go to https://generate-secret.vercel.app/32
*
* @default process.env.AUTH_SECRET ?? process.env.NEXTAUTH_SECRET
*
* [Documentation](https://next-auth.js.org/configuration/options#secret)
*/
secret?: string
/**
* Configure your session like if you want to use JWT or a database,
* how long until an idle session expires, or to throttle write operations in case you are using a database.
* * **Default value**: See the documentation page
* * **Required**: No
*
* [Documentation](https://next-auth.js.org/configuration/options#session)
*/
session?: Partial<SessionOptions>
/**
* JSON Web Tokens are enabled by default if you have not specified an {@link AuthConfig.adapter}.
* JSON Web Tokens are enabled by default if you have not specified an adapter.
* JSON Web Tokens are encrypted (JWE) by default. We recommend you keep this behaviour.
* * **Default value**: See the documentation page
* * **Required**: *No*
*
* [Documentation](https://next-auth.js.org/configuration/options#jwt)
*/
jwt?: Partial<JWTOptions>
/**
* Specify URLs to be used if you want to create custom sign in, sign out and error pages.
* Pages specified will override the corresponding built-in page.
* * **Default value**: `{}`
* * **Required**: *No*
*
* @default {}
* @example
*
* ```ts
@@ -206,12 +222,18 @@ export interface AuthConfig {
* newUser: '/auth/new-user'
* }
* ```
*
* [Documentation](https://next-auth.js.org/configuration/options#pages) | [Pages documentation](https://next-auth.js.org/configuration/pages)
*/
pages?: Partial<PagesOptions>
/**
* Callbacks are asynchronous functions you can use to control what happens when an action is performed.
* Callbacks are *extremely powerful*, especially in scenarios involving JSON Web Tokens
* as they **allow you to implement access controls without a database** and to **integrate with external databases or APIs**.
* * **Default value**: See the Callbacks documentation
* * **Required**: *No*
*
* [Documentation](https://next-auth.js.org/configuration/options#callbacks) | [Callbacks documentation](https://next-auth.js.org/configuration/callbacks)
*/
callbacks?: Partial<CallbacksOptions>
/**
@@ -221,23 +243,36 @@ export interface AuthConfig {
* (e.g. OAuth or Email authentication flow, JWT or database sessions, etc),
* but typically contains a user object and/or contents of the JSON Web Token
* and other information relevant to the event.
* * **Default value**: `{}`
* * **Required**: *No*
*
* @default {}
* [Documentation](https://next-auth.js.org/configuration/options#events) | [Events documentation](https://next-auth.js.org/configuration/events)
*/
events?: Partial<EventCallbacks>
/** You can use the adapter option to pass in your database adapter. */
/**
* You can use the adapter option to pass in your database adapter.
*
* * **Required**: *No*
*
* [Documentation](https://next-auth.js.org/configuration/options#adapter) |
* [Adapters Overview](https://next-auth.js.org/adapters/overview)
*/
adapter?: Adapter
/**
* Set debug to true to enable debug messages for authentication and database operations.
* * **Default value**: `false`
* * **Required**: *No*
*
* - ⚠ If you added a custom {@link AuthConfig.logger}, this setting is ignored.
* - ⚠ If you added a custom `logger`, this setting is ignored.
*
* @default false
* [Documentation](https://next-auth.js.org/configuration/options#debug) | [Logger documentation](https://next-auth.js.org/configuration/options#logger)
*/
debug?: boolean
/**
* Override any of the logger levels (`undefined` levels will use the built-in logger),
* and intercept logs in NextAuth. You can use this option to send NextAuth logs to a third-party logging service.
* * **Default value**: `console`
* * **Required**: *No*
*
* @example
*
@@ -259,24 +294,36 @@ export interface AuthConfig {
* })
* ```
*
* - ⚠ When set, the {@link AuthConfig.debug} option is ignored
* - ⚠ When set, the `debug` option is ignored
*
* @default console
* [Documentation](https://next-auth.js.org/configuration/options#logger) |
* [Debug documentation](https://next-auth.js.org/configuration/options#debug)
*/
logger?: Partial<LoggerInstance>
/** Changes the theme of built-in {@link AuthConfig.pages}. */
/**
* Changes the theme of pages.
* Set to `"light"` if you want to force pages to always be light.
* Set to `"dark"` if you want to force pages to always be dark.
* Set to `"auto"`, (or leave this option out)if you want the pages to follow the preferred system theme.
* * **Default value**: `"auto"`
* * **Required**: *No*
*
* [Documentation](https://next-auth.js.org/configuration/options#theme) | [Pages documentation]("https://next-auth.js.org/configuration/pages")
*/
theme?: Theme
/**
* When set to `true` then all cookies set by NextAuth.js will only be accessible from HTTPS URLs.
* This option defaults to `false` on URLs that start with `http://` (e.g. http://localhost:3000) for developer convenience.
* You can manually set this option to `false` to disable this security feature and allow cookies
* to be accessible from non-secured URLs (this is not recommended).
* * **Default value**: `true` for HTTPS and `false` for HTTP sites
* * **Required**: No
*
* [Documentation](https://next-auth.js.org/configuration/options#usesecurecookies)
*
* - ⚠ **This is an advanced option.** Advanced options are passed the same way as basic options,
* but **may have complex implications** or side effects.
* You should **try to avoid using advanced options** unless you are very comfortable using them.
*
* The default is `false` HTTP and `true` for HTTPS sites.
*/
useSecureCookies?: boolean
/**
@@ -286,14 +333,25 @@ export interface AuthConfig {
* If you use this feature, you will likely want to create conditional behavior
* to support setting different cookies policies in development and production builds,
* as you will be opting out of the built-in dynamic policy.
* * **Default value**: `{}`
* * **Required**: No
*
* - ⚠ **This is an advanced option.** Advanced options are passed the same way as basic options,
* but **may have complex implications** or side effects.
* You should **try to avoid using advanced options** unless you are very comfortable using them.
*
* @default {}
* [Documentation](https://next-auth.js.org/configuration/options#cookies) | [Usage example](https://next-auth.js.org/configuration/options#example)
*/
cookies?: Partial<CookiesOptions>
/** @todo */
/**
* If set to `true`, NextAuth.js will use either the `x-forwarded-host` or `host` headers,
* instead of `NEXTAUTH_URL`
* Make sure that reading `x-forwarded-host` on your hosting platform can be trusted.
* - ⚠ **This is an advanced option.** Advanced options are passed the same way as basic options,
* but **may have complex implications** or side effects.
* You should **try to avoid using advanced options** unless you are very comfortable using them.
*
* @default Boolean(process.env.NEXTAUTH_URL ?? process.env.AUTH_TRUST_HOST ?? process.env.VERCEL)
*/
trustHost?: boolean
}

View File

@@ -1,6 +1,6 @@
{
"name": "@auth/sveltekit",
"version": "0.1.8",
"version": "0.1.6",
"description": "Authentication for SvelteKit.",
"homepage": "https://sveltekit.authjs.dev",
"repository": "https://github.com/nextauthjs/next-auth.git",
@@ -68,4 +68,4 @@
},
"./package.json": "./package.json"
}
}
}

8
pnpm-lock.yaml generated
View File

@@ -13,7 +13,7 @@ importers:
.:
specifiers:
'@actions/core': ^1.6.0
'@balazsorban/monorepo-release': 0.1.7
'@balazsorban/monorepo-release': 0.1.1
'@types/jest': ^28.1.3
'@types/node': ^17.0.25
'@typescript-eslint/eslint-plugin': ^5.10.2
@@ -38,7 +38,7 @@ importers:
typescript: 4.8.4
devDependencies:
'@actions/core': 1.9.0
'@balazsorban/monorepo-release': 0.1.7
'@balazsorban/monorepo-release': 0.1.1
'@types/jest': 28.1.3
'@types/node': 17.0.45
'@typescript-eslint/eslint-plugin': 5.29.0_k4l66av2tbo6kxzw52jzgbfzii
@@ -5416,8 +5416,8 @@ packages:
'@babel/helper-validator-identifier': 7.19.1
to-fast-properties: 2.0.0
/@balazsorban/monorepo-release/0.1.7:
resolution: {integrity: sha512-B+6JeY4ZPrVbocAi+6oJ1j2eanUN0KHrOf3FAzCJzKFVC+xCudIbMbzji3UulikOyeFmmmt/If+/yOmzXS+AEQ==}
/@balazsorban/monorepo-release/0.1.1:
resolution: {integrity: sha512-fzloVznwo4OoBpeY57gh6QetvAflkDyys4wbERz3gtxBhGf1QyIwNFj2QuCxe4DL/T1luDxJocC+zAlZ00JGWQ==}
engines: {node: '>=16.16.0'}
hasBin: true
dependencies: