Forgot password endpoint require a CSRF token. (#154)

This commit is contained in:
Waheed Ahmed
2021-02-22 15:50:55 +05:00
committed by GitHub
parent f12008136f
commit ad9a9c4895

View File

@@ -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 }),