Files
medusa-store/www/apps/docs/content/references/services/classes/TokenService.mdx
github-actions[bot] 39649b3552 chore(docs): Generated References (#5602)
Generated the following references:
- `pricing`
- `product`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2023-11-10 17:31:02 +00:00

141 lines
2.4 KiB
Plaintext

---
displayed_sidebar: servicesSidebar
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# TokenService
## Constructors
### constructor
**new TokenService**(`«destructured»`)
#### Parameters
<ParameterTypes parameters={[
{
"name": "__namedParameters",
"type": "[`InjectedDependencies`](../types/InjectedDependencies-41.mdx)",
"description": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
## Properties
<ParameterTypes parameters={[
{
"name": "configModule_",
"type": "[`ConfigModule`](../types/ConfigModule.mdx)",
"description": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "RESOLUTION_KEY",
"type": "`string`",
"description": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
## Methods
### signToken
**signToken**(`data`, `options?`): `string`
#### Parameters
<ParameterTypes parameters={[
{
"name": "data",
"type": "`string` \\| `object` \\| [`Buffer`](../index.md#buffer)",
"description": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "options",
"type": "`SignOptions`",
"description": "",
"optional": true,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
#### Returns
`string`
<ParameterTypes parameters={[
{
"name": "string",
"type": "`string`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />
___
### verifyToken
**verifyToken**(`token`, `options?`): `string` \| `Jwt` \| `JwtPayload`
#### Parameters
<ParameterTypes parameters={[
{
"name": "token",
"type": "`string`",
"description": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "options",
"type": "`VerifyOptions`",
"description": "",
"optional": true,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
#### Returns
`string` \| `Jwt` \| `JwtPayload`
<ParameterTypes parameters={[
{
"name": "string \\| Jwt \\| JwtPayload",
"type": "`string` \\| `Jwt` \\| `JwtPayload`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />