Compare commits

...

8 Commits

Author SHA1 Message Date
Balázs Orbán
a39b8cfdf4 fix(ts): correct credentials types in authorize callback 2023-02-08 16:12:19 +01:00
AlandSleman
cee1bddbd5 docs: Fix Getting started page (#6636)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2023-02-07 15:08:29 +01:00
Rémi Robichet
e0ae913e5c docs: fix type import (#6638) 2023-02-07 15:06:48 +01:00
Thang Vu
1db27fcd07 chore(monorepo): cache docs/build 2023-02-06 10:03:32 +07:00
Thang Vu
95407df289 chore(monorepo): cache typedoc generated files 2023-02-06 09:54:36 +07:00
Balázs Orbán
22adc2eb3c docs: fix redirects 2023-02-06 00:04:44 +01:00
Balázs Orbán
725f976b39 docs: fix redirects 2023-02-06 00:03:28 +01:00
MatyiFKBT
28ae5d4639 fix(providers): update Foursquare API version (#6620) 2023-02-05 15:30:57 +01:00
7 changed files with 29 additions and 10 deletions

View File

@@ -253,11 +253,13 @@ Once inserted and correct, Github will redirect the user to our app and Auth.js
<img src={nextAuthUserLoggedIn} />
Great! We have completed the whole E2E authentication flow setup so that users can login in our application through Github!
:::
:::info
You can create your own Sign In page instead of using the default one from Auth.js. You can learn how to do so in our dedicated guide for it.
You can create your own Sign In page instead of using the default one from Auth.js. You can learn how to do so in our [dedicated guide for it](/guides/basics/pages).
:::
## 4. Deploying to production
### Configuring different environments

View File

@@ -11,7 +11,7 @@ When using SSR, I recommend creating a `Protected` component that will trigger s
```tsx
// components/Protected.tsx
import { type Session } from "@auth/core";
import { type Session } from "@auth/core/types";
import { getSession } from "@auth/solid-start";
import { Component, Show } from "solid-js";
import { useRouteData } from "solid-start";

View File

@@ -73,7 +73,7 @@
"value": "sveltekit.authjs.dev"
}
],
"destination": "https://authjs.dev/reference/sveltekit/modules/main"
"destination": "https://authjs.dev/reference/sveltekit"
},
{
"source": "/",
@@ -93,7 +93,7 @@
"value": "errors.authjs.dev"
}
],
"destination": "https://authjs.dev/reference/core/modules/errors/:path*"
"destination": "https://authjs.dev/reference/core/errors/:path*"
},
{
"source": "/:path(.*)",
@@ -123,7 +123,7 @@
"value": "providers.authjs.dev"
}
],
"destination": "https://authjs.dev/reference/core/functions/providers_:path.default"
"destination": "https://authjs.dev/reference/core/providers_:path.default"
}
]
}

View File

@@ -264,7 +264,7 @@ export async function callback(params: {
// Callback URL is already verified at this point, so safe to use if specified
return { redirect: callbackUrl, cookies }
} else if (provider.type === "credentials" && method === "POST") {
const credentials = body
const credentials = body ?? {}
// TODO: Forward the original request as is, instead of reconstructing it
Object.entries(query ?? {}).forEach(([k, v]) =>

View File

@@ -40,8 +40,16 @@ export interface CredentialsConfig<
* //...
*/
authorize: (
/** See {@link CredentialInput} */
credentials: Record<keyof CredentialsInputs, string> | undefined,
/**
* The available keys are determined by {@link CredentialInput}.
*
* @note The existence/correctness of a field cannot be guaranteed at runtime,
* so you should always validate the input before using it.
*
* You can add basic validation depending on your use case,
* or you can use a popular library like [Zod](https://zod.dev) for example.
*/
credentials: Partial<Record<keyof CredentialsInputs, unknown>>,
/** The original request is forward for convenience */
request: Request
) => Awaitable<User | null>

View File

@@ -1,6 +1,6 @@
/** @type {import(".").OAuthProvider} */
export default function Foursquare(options) {
const { apiVersion = "20210801" } = options
const { apiVersion = "20230131" } = options
return {
id: "foursquare",
name: "Foursquare",
@@ -15,7 +15,7 @@ export default function Foursquare(options) {
return fetch(url).then((res) => res.json())
},
},
profile({ response: { profile } }) {
profile({ response: { user: profile } }) {
return {
id: profile.id,
name: `${profile.firstName} ${profile.lastName}`,

View File

@@ -47,6 +47,15 @@
"docs#dev": {
"dependsOn": ["^build"],
"cache": false
},
"docs#build": {
"dependsOn": ["^build"],
"outputs": [
"build",
"docs/reference/core",
"docs/reference/sveltekit",
"docs/reference/adapter/**"
]
}
}
}