mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
Compare commits
8 Commits
@auth/svel
...
fix/creden
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a39b8cfdf4 | ||
|
|
cee1bddbd5 | ||
|
|
e0ae913e5c | ||
|
|
1db27fcd07 | ||
|
|
95407df289 | ||
|
|
22adc2eb3c | ||
|
|
725f976b39 | ||
|
|
28ae5d4639 |
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -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]) =>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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}`,
|
||||
|
||||
@@ -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/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user