synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
39 lines (38 loc) • 1.13 kB
JavaScript
import { CHANGE_PASSWORD as r } from "../../../utils/APIConstants.js";
import { ErrorResponseCode as p } from "@sage-bionetworks/synapse-types";
import { http as t, HttpResponse as s } from "msw";
function R(e) {
return t.post(e + r, () => new Response(null, { status: 204 }));
}
function g(e, o) {
return t.post(e + r, () => s.json(
{
concreteType: "org.sagebionetworks.repo.model.ErrorResponse",
reason: o
},
{ status: 401 }
));
}
function l(e, o, n) {
return t.post(
e + r,
async ({ request: a }) => {
if ("twoFaToken" in await a.json())
return new Response(null, { status: 204 });
const u = {
concreteType: "org.sagebionetworks.repo.model.auth.TwoFactorAuthErrorResponse",
reason: "Two factor authentication required.",
errorCode: p.TWO_FA_REQUIRED,
userId: o,
twoFaToken: n
};
return s.json(u, { status: 401 });
}
);
}
export {
g as getBadRequestChangePasswordHandler,
l as getRequires2FAChangePasswordHandler,
R as getSuccessfulChangePasswordHandler
};
//# sourceMappingURL=changePasswordHandlers.js.map