Skip to main content

Class: AuthResource

Hierarchy

  • defaultCopy to Clipboard

    AuthResourceCopy to Clipboard

Methods

authenticate

authenticate(payloadCopy to Clipboard, customHeaders?Copy to Clipboard): ResponsePromiseCopy to Clipboard<StoreAuthResCopy to Clipboard>

DescriptionCopy to Clipboard

Authenticates a customer using email and password combination

Parameters

NameTypeDescription
payloadCopy to ClipboardStorePostAuthReqCopy to Clipboardauthentication payload
customHeadersCopy to ClipboardRecordCopy to Clipboard<stringCopy to Clipboard, anyCopy to Clipboard>

Returns

ResponsePromiseCopy to Clipboard<StoreAuthResCopy to Clipboard>

Defined in

medusa-js/src/resources/auth.ts:16


deleteSession

deleteSession(customHeaders?Copy to Clipboard): ResponsePromiseCopy to Clipboard<voidCopy to Clipboard>

DescriptionCopy to Clipboard

Removes authentication session

Parameters

NameType
customHeadersCopy to ClipboardRecordCopy to Clipboard<stringCopy to Clipboard, anyCopy to Clipboard>

Returns

ResponsePromiseCopy to Clipboard<voidCopy to Clipboard>

Defined in

medusa-js/src/resources/auth.ts:25


exists

exists(emailCopy to Clipboard, customHeaders?Copy to Clipboard): ResponsePromiseCopy to Clipboard<StoreGetAuthEmailResCopy to Clipboard>

DescriptionCopy to Clipboard

Check if email exists

Parameters

NameTypeDescription
emailCopy to ClipboardstringCopy to Clipboardis required
customHeadersCopy to ClipboardRecordCopy to Clipboard<stringCopy to Clipboard, anyCopy to Clipboard>

Returns

ResponsePromiseCopy to Clipboard<StoreGetAuthEmailResCopy to Clipboard>

Defined in

medusa-js/src/resources/auth.ts:47


getSession

getSession(customHeaders?Copy to Clipboard): ResponsePromiseCopy to Clipboard<StoreAuthResCopy to Clipboard>

DescriptionCopy to Clipboard

Retrieves an authenticated session Usually used to check if authenticated session is alive.

Parameters

NameType
customHeadersCopy to ClipboardRecordCopy to Clipboard<stringCopy to Clipboard, anyCopy to Clipboard>

Returns

ResponsePromiseCopy to Clipboard<StoreAuthResCopy to Clipboard>

Defined in

medusa-js/src/resources/auth.ts:36