Files
medusa-store/docs/content/references/js-client/classes/AuthResource.md
Shahed Nasser 02d5c1da88 docs: update Typedoc and regenerate references (#1994)
* generated new services reference

* changed from automatic push to automated pull request

* updated typedoc, regenerated JS Client reference

* regenerated the reference after updating typedoc

* added action for js client
2022-08-04 17:29:52 +03:00

83 lines
2.2 KiB
Markdown

# Class: AuthResource
## Hierarchy
- `default`
**`AuthResource`**
## Methods
### authenticate
**authenticate**(`payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreAuthRes`](../modules/internal-29.md#storeauthres)\>
**`Description`**
Authenticates a customer using email and password combination
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `payload` | [`StorePostAuthReq`](internal-29.StorePostAuthReq.md) | authentication payload |
| `customHeaders` | `Record`<`string`, `any`\> | |
#### Returns
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreAuthRes`](../modules/internal-29.md#storeauthres)\>
#### Defined in
[medusa-js/src/resources/auth.ts:16](https://github.com/medusajs/medusa/blob/e38dd7f6/packages/medusa-js/src/resources/auth.ts#L16)
___
### exists
**exists**(`email`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreGetAuthEmailRes`](../modules/internal-29.md#storegetauthemailres)\>
**`Description`**
Check if email exists
#### Parameters
| Name | Type | Description |
| :------ | :------ | :------ |
| `email` | `string` | is required |
| `customHeaders` | `Record`<`string`, `any`\> | |
#### Returns
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreGetAuthEmailRes`](../modules/internal-29.md#storegetauthemailres)\>
#### Defined in
[medusa-js/src/resources/auth.ts:38](https://github.com/medusajs/medusa/blob/e38dd7f6/packages/medusa-js/src/resources/auth.ts#L38)
___
### getSession
**getSession**(`customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreAuthRes`](../modules/internal-29.md#storeauthres)\>
**`Description`**
Retrieves an authenticated session
Usually used to check if authenticated session is alive.
#### Parameters
| Name | Type |
| :------ | :------ |
| `customHeaders` | `Record`<`string`, `any`\> |
#### Returns
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreAuthRes`](../modules/internal-29.md#storeauthres)\>
#### Defined in
[medusa-js/src/resources/auth.ts:27](https://github.com/medusajs/medusa/blob/e38dd7f6/packages/medusa-js/src/resources/auth.ts#L27)