docs: adds notes about importance of serverURL for verify / forgot-pa… (#10248)
Fixes #10235
This commit is contained in:
@@ -269,9 +269,9 @@ const result = await payload.verifyEmail({
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that the token you need to pass to the `verifyEmail` function is unique to verification and is not the same as the token that you can retrieve from the `forgotPassword` operation. It can be found on the user document, as a hidden `_verificationToken` field.
|
**Note:** the token you need to pass to the `verifyEmail` function is unique to verification and is not the same as the token that you can retrieve from the `forgotPassword` operation. It can be found on the user document, as a hidden `_verificationToken` field. If you'd like to retrieve this token, you can use the Local API's `find` or `findByID` methods, setting `showHiddenFields: true`.
|
||||||
|
|
||||||
If you'd like to retrieve this token, you can use the Local API's `find` or `findByID` methods, setting `showHiddenFields: true`.
|
**Note:** if you do not have a `config.serverURL` set, Payload will attempt to create one for you if the user was created via REST or GraphQL by looking at the incoming `req`. But this is not supported if you are creating the user via the Local API's `payload.create()` method. If this applies to you, and you do not have a `serverURL` set, you may want to override your `verify.generateEmailHTML` function to provide a full URL to link the user to a proper verification page.
|
||||||
|
|
||||||
## Unlock
|
## Unlock
|
||||||
|
|
||||||
@@ -348,6 +348,8 @@ const token = await payload.forgotPassword({
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Note:** if you do not have a `config.serverURL` set, Payload will attempt to create one for you if the `forgot-password` operation was triggered via REST or GraphQL by looking at the incoming `req`. But this is not supported if you are calling `payload.forgotPassword()` via the Local API. If you do not have a `serverURL` set, you may want to override your `auth.forgotPassword.generateEmailHTML` function to provide a full URL to link the user to a proper reset-password page.
|
||||||
|
|
||||||
<Banner type="success">
|
<Banner type="success">
|
||||||
**Tip:**
|
**Tip:**
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ _\* An asterisk denotes that a property is required._
|
|||||||
Some properties are removed from the client-side bundle. [More details](../admin/components#accessing-the-payload-config).
|
Some properties are removed from the client-side bundle. [More details](../admin/components#accessing-the-payload-config).
|
||||||
</Banner>
|
</Banner>
|
||||||
|
|
||||||
|
|
||||||
### Typescript Config
|
### Typescript Config
|
||||||
|
|
||||||
Payload exposes a variety of TypeScript settings that you can leverage. These settings are used to auto-generate TypeScript interfaces for your [Collections](../configuration/collections) and [Globals](../configuration/globals), and to ensure that Payload uses your [Generated Types](../typescript/overview) for all [Local API](../local-api/overview) methods.
|
Payload exposes a variety of TypeScript settings that you can leverage. These settings are used to auto-generate TypeScript interfaces for your [Collections](../configuration/collections) and [Globals](../configuration/globals), and to ensure that Payload uses your [Generated Types](../typescript/overview) for all [Local API](../local-api/overview) methods.
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ import { BannerBlock } from '../../mdx/jsxBlocks/banner.js'
|
|||||||
import { CodeBlock } from '../../mdx/jsxBlocks/code/code.js'
|
import { CodeBlock } from '../../mdx/jsxBlocks/code/code.js'
|
||||||
import { InlineCodeBlock } from '../../mdx/jsxBlocks/inlineCode.js'
|
import { InlineCodeBlock } from '../../mdx/jsxBlocks/inlineCode.js'
|
||||||
import { PackageInstallOptions } from '../../mdx/jsxBlocks/packageInstallOptions.js'
|
import { PackageInstallOptions } from '../../mdx/jsxBlocks/packageInstallOptions.js'
|
||||||
|
import { RestExamplesBlock } from '../../mdx/jsxBlocks/restExamples/index.js'
|
||||||
import { TextContainerBlock } from '../../mdx/jsxBlocks/TextContainer.js'
|
import { TextContainerBlock } from '../../mdx/jsxBlocks/TextContainer.js'
|
||||||
import { TextContainerNoTrimBlock } from '../../mdx/jsxBlocks/TextContainerNoTrim.js'
|
import { TextContainerNoTrimBlock } from '../../mdx/jsxBlocks/TextContainerNoTrim.js'
|
||||||
import { RestExamplesBlock } from '../../mdx/jsxBlocks/restExamples/index.js'
|
|
||||||
|
|
||||||
export const postsSlug = 'posts'
|
export const postsSlug = 'posts'
|
||||||
|
|
||||||
|
|||||||
@@ -44,4 +44,4 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"frontMatter": []
|
"frontMatter": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { tableJson } from '../tableJson.js'
|
|
||||||
import type { Test } from '../int.spec.js'
|
import type { Test } from '../int.spec.js'
|
||||||
|
|
||||||
|
import { tableJson } from '../tableJson.js'
|
||||||
import { textToRichText } from '../textToRichText.js'
|
import { textToRichText } from '../textToRichText.js'
|
||||||
|
|
||||||
export const defaultTests: Test[] = [
|
export const defaultTests: Test[] = [
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { readFileSync } from 'fs'
|
import { readFileSync } from 'fs'
|
||||||
import type { Test } from '../int.spec.js'
|
|
||||||
import { fileURLToPath } from 'url'
|
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
import { fileURLToPath } from 'url'
|
||||||
|
|
||||||
|
import type { Test } from '../int.spec.js'
|
||||||
|
|
||||||
const filename = fileURLToPath(import.meta.url)
|
const filename = fileURLToPath(import.meta.url)
|
||||||
const dirname = path.dirname(filename)
|
const dirname = path.dirname(filename)
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { readFileSync } from 'fs'
|
import { readFileSync } from 'fs'
|
||||||
import type { Test } from '../int.spec.js'
|
|
||||||
import { fileURLToPath } from 'url'
|
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
import { fileURLToPath } from 'url'
|
||||||
|
|
||||||
|
import type { Test } from '../int.spec.js'
|
||||||
|
|
||||||
const filename = fileURLToPath(import.meta.url)
|
const filename = fileURLToPath(import.meta.url)
|
||||||
const dirname = path.dirname(filename)
|
const dirname = path.dirname(filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user