better-auth
Version:
The most comprehensive authentication framework for TypeScript.
18 lines (17 loc) • 434 B
JavaScript
//#region src/client/fetch-plugins.ts
const redirectPlugin = {
id: "redirect",
name: "Redirect",
hooks: { onSuccess(context) {
if (context.data?.url && context.data?.redirect) {
if (typeof window !== "undefined" && window.location) {
if (window.location) try {
window.location.href = context.data.url;
} catch {}
}
}
} }
};
//#endregion
export { redirectPlugin };
//# sourceMappingURL=fetch-plugins.mjs.map