Forgot password endpoint require a CSRF token. (#154)
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import { getConfig } from '@edx/frontend-platform';
|
||||
import { getHttpClient } from '@edx/frontend-platform/auth';
|
||||
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
|
||||
import formurlencoded from 'form-urlencoded';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export async function forgotPassword(email) {
|
||||
const requestConfig = {
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
isPublic: true,
|
||||
};
|
||||
|
||||
const { data } = await getHttpClient()
|
||||
const { data } = await getAuthenticatedHttpClient()
|
||||
.post(
|
||||
`${getConfig().LMS_BASE_URL}/account/password`,
|
||||
formurlencoded({ email }),
|
||||
|
||||
Reference in New Issue
Block a user