Files
frontend-app-authn/src/forgot-password/data/service.js
Adolfo R. Brandes 8f8531a242 refactor: migrate to frontend-base
BREAKING CHANGE: refactors the MFE for frontend-base.
2025-06-24 15:30:07 -03:00

22 lines
543 B
JavaScript

import { getAuthenticatedHttpClient, getSiteConfig } from '@openedx/frontend-base';
import formurlencoded from 'form-urlencoded';
export async function forgotPassword(email) {
const requestConfig = {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
isPublic: true,
};
const { data } = await getAuthenticatedHttpClient()
.post(
`${getSiteConfig().lmsBaseUrl}/account/password`,
formurlencoded({ email }),
requestConfig,
)
.catch((e) => {
throw (e);
});
return data;
}