authhero 0.27.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authhero.cjs +1 -1
- package/dist/authhero.d.ts +3 -0
- package/dist/authhero.mjs +24 -25
- package/package.json +1 -1
package/dist/authhero.d.ts
CHANGED
|
@@ -4398,11 +4398,14 @@ export type OnExecuteCredentialsExchangeAPI = {
|
|
|
4398
4398
|
};
|
|
4399
4399
|
export type OnExecuteCredentialsExchange = (event: OnExecuteCredentialsExchangeEvent, access: OnExecuteCredentialsExchangeAPI) => Promise<void>;
|
|
4400
4400
|
export type SendEmailParams = {
|
|
4401
|
+
emailProvider: EmailProvider;
|
|
4401
4402
|
to: string;
|
|
4402
4403
|
from: string;
|
|
4403
4404
|
subject: string;
|
|
4404
4405
|
html?: string;
|
|
4405
4406
|
text?: string;
|
|
4407
|
+
template: string;
|
|
4408
|
+
data: Record<string, string>;
|
|
4406
4409
|
};
|
|
4407
4410
|
export type SendEmailResponse = {};
|
|
4408
4411
|
export type EmailService = (param: SendEmailParams) => Promise<SendEmailResponse>;
|
package/dist/authhero.mjs
CHANGED
|
@@ -22905,38 +22905,37 @@ function Z2(r) {
|
|
|
22905
22905
|
useragent: (i = r.header("user-agent")) == null ? void 0 : i.slice(0, 512)
|
|
22906
22906
|
};
|
|
22907
22907
|
}
|
|
22908
|
-
async function Tf(r, e, a
|
|
22909
|
-
var
|
|
22910
|
-
const
|
|
22911
|
-
if (!
|
|
22908
|
+
async function Tf(r, e, a) {
|
|
22909
|
+
var n;
|
|
22910
|
+
const i = await r.env.data.emailProviders.get(e);
|
|
22911
|
+
if (!i)
|
|
22912
22912
|
throw new se(500, { message: "Email provider not found" });
|
|
22913
|
-
const
|
|
22914
|
-
if (!
|
|
22913
|
+
const t = (n = r.env.emailProviders) == null ? void 0 : n[i.name];
|
|
22914
|
+
if (!t)
|
|
22915
22915
|
throw new se(500, { message: "Email provider not found" });
|
|
22916
|
-
await
|
|
22917
|
-
|
|
22918
|
-
|
|
22919
|
-
|
|
22920
|
-
html: t
|
|
22916
|
+
await t({
|
|
22917
|
+
emailProvider: i,
|
|
22918
|
+
...a,
|
|
22919
|
+
from: i.default_from_address || `login@${r.env.ISSUER}`
|
|
22921
22920
|
});
|
|
22922
22921
|
}
|
|
22923
22922
|
async function H2(r, e, a, i, t) {
|
|
22924
|
-
await Tf(
|
|
22925
|
-
|
|
22926
|
-
|
|
22927
|
-
|
|
22928
|
-
"
|
|
22929
|
-
|
|
22930
|
-
);
|
|
22923
|
+
await Tf(r, e, {
|
|
22924
|
+
to: a,
|
|
22925
|
+
subject: "Reset your password",
|
|
22926
|
+
html: `Click here to reset your password: ${r.env.ISSUER}u/reset-password?state=${t}&code=${i}`,
|
|
22927
|
+
template: "auth-password-reset",
|
|
22928
|
+
data: { code: i, state: t || "" }
|
|
22929
|
+
});
|
|
22931
22930
|
}
|
|
22932
22931
|
async function F2(r, e, a) {
|
|
22933
|
-
await Tf(
|
|
22934
|
-
|
|
22935
|
-
|
|
22936
|
-
|
|
22937
|
-
"
|
|
22938
|
-
|
|
22939
|
-
);
|
|
22932
|
+
await Tf(r, e, {
|
|
22933
|
+
to: a.email,
|
|
22934
|
+
subject: "Validate your email address",
|
|
22935
|
+
html: `Click here to validate your email: ${r.env.ISSUER}u/validate-email`,
|
|
22936
|
+
template: "auth-verify-email",
|
|
22937
|
+
data: {}
|
|
22938
|
+
});
|
|
22940
22939
|
}
|
|
22941
22940
|
const K2 = new Qe().openapi(
|
|
22942
22941
|
he({
|