authhero 0.95.0 → 0.97.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 +4 -4
- package/dist/authhero.d.ts +11 -11
- package/dist/authhero.mjs +27 -18
- package/package.json +3 -3
package/dist/authhero.d.ts
CHANGED
|
@@ -2302,7 +2302,7 @@ export declare const loginSessionInsertSchema: z.ZodObject<{
|
|
|
2302
2302
|
deleted_at: z.ZodOptional<z.ZodString>;
|
|
2303
2303
|
ip: z.ZodOptional<z.ZodString>;
|
|
2304
2304
|
useragent: z.ZodOptional<z.ZodString>;
|
|
2305
|
-
|
|
2305
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
2306
2306
|
authorization_url: z.ZodOptional<z.ZodString>;
|
|
2307
2307
|
}, "strip", z.ZodTypeAny, {
|
|
2308
2308
|
expires_at: string;
|
|
@@ -2329,7 +2329,7 @@ export declare const loginSessionInsertSchema: z.ZodObject<{
|
|
|
2329
2329
|
deleted_at?: string | undefined;
|
|
2330
2330
|
ip?: string | undefined;
|
|
2331
2331
|
useragent?: string | undefined;
|
|
2332
|
-
|
|
2332
|
+
session_id?: string | undefined;
|
|
2333
2333
|
authorization_url?: string | undefined;
|
|
2334
2334
|
}, {
|
|
2335
2335
|
expires_at: string;
|
|
@@ -2356,7 +2356,7 @@ export declare const loginSessionInsertSchema: z.ZodObject<{
|
|
|
2356
2356
|
deleted_at?: string | undefined;
|
|
2357
2357
|
ip?: string | undefined;
|
|
2358
2358
|
useragent?: string | undefined;
|
|
2359
|
-
|
|
2359
|
+
session_id?: string | undefined;
|
|
2360
2360
|
authorization_url?: string | undefined;
|
|
2361
2361
|
}>;
|
|
2362
2362
|
export type LoginSessionInsert = z.infer<typeof loginSessionInsertSchema>;
|
|
@@ -2422,7 +2422,7 @@ export declare const loginSessionSchema: z.ZodObject<{
|
|
|
2422
2422
|
deleted_at: z.ZodOptional<z.ZodString>;
|
|
2423
2423
|
ip: z.ZodOptional<z.ZodString>;
|
|
2424
2424
|
useragent: z.ZodOptional<z.ZodString>;
|
|
2425
|
-
|
|
2425
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
2426
2426
|
authorization_url: z.ZodOptional<z.ZodString>;
|
|
2427
2427
|
}, "strip", z.ZodTypeAny, {
|
|
2428
2428
|
created_at: string;
|
|
@@ -2452,7 +2452,7 @@ export declare const loginSessionSchema: z.ZodObject<{
|
|
|
2452
2452
|
deleted_at?: string | undefined;
|
|
2453
2453
|
ip?: string | undefined;
|
|
2454
2454
|
useragent?: string | undefined;
|
|
2455
|
-
|
|
2455
|
+
session_id?: string | undefined;
|
|
2456
2456
|
authorization_url?: string | undefined;
|
|
2457
2457
|
}, {
|
|
2458
2458
|
created_at: string;
|
|
@@ -2482,7 +2482,7 @@ export declare const loginSessionSchema: z.ZodObject<{
|
|
|
2482
2482
|
deleted_at?: string | undefined;
|
|
2483
2483
|
ip?: string | undefined;
|
|
2484
2484
|
useragent?: string | undefined;
|
|
2485
|
-
|
|
2485
|
+
session_id?: string | undefined;
|
|
2486
2486
|
authorization_url?: string | undefined;
|
|
2487
2487
|
}>;
|
|
2488
2488
|
export type LoginSession = z.infer<typeof loginSessionSchema>;
|
|
@@ -4382,6 +4382,7 @@ export declare const refreshTokenInsertSchema: z.ZodObject<{
|
|
|
4382
4382
|
user_id: string;
|
|
4383
4383
|
id: string;
|
|
4384
4384
|
client_id: string;
|
|
4385
|
+
session_id: string;
|
|
4385
4386
|
device: {
|
|
4386
4387
|
last_ip: string;
|
|
4387
4388
|
initial_user_agent: string;
|
|
@@ -4390,7 +4391,6 @@ export declare const refreshTokenInsertSchema: z.ZodObject<{
|
|
|
4390
4391
|
last_user_agent: string;
|
|
4391
4392
|
last_asn: string;
|
|
4392
4393
|
};
|
|
4393
|
-
session_id: string;
|
|
4394
4394
|
resource_servers: {
|
|
4395
4395
|
audience: string;
|
|
4396
4396
|
scopes: string;
|
|
@@ -4403,6 +4403,7 @@ export declare const refreshTokenInsertSchema: z.ZodObject<{
|
|
|
4403
4403
|
user_id: string;
|
|
4404
4404
|
id: string;
|
|
4405
4405
|
client_id: string;
|
|
4406
|
+
session_id: string;
|
|
4406
4407
|
device: {
|
|
4407
4408
|
last_ip: string;
|
|
4408
4409
|
initial_user_agent: string;
|
|
@@ -4411,7 +4412,6 @@ export declare const refreshTokenInsertSchema: z.ZodObject<{
|
|
|
4411
4412
|
last_user_agent: string;
|
|
4412
4413
|
last_asn: string;
|
|
4413
4414
|
};
|
|
4414
|
-
session_id: string;
|
|
4415
4415
|
resource_servers: {
|
|
4416
4416
|
audience: string;
|
|
4417
4417
|
scopes: string;
|
|
@@ -4469,6 +4469,7 @@ export declare const refreshTokenSchema: z.ZodObject<{
|
|
|
4469
4469
|
user_id: string;
|
|
4470
4470
|
id: string;
|
|
4471
4471
|
client_id: string;
|
|
4472
|
+
session_id: string;
|
|
4472
4473
|
device: {
|
|
4473
4474
|
last_ip: string;
|
|
4474
4475
|
initial_user_agent: string;
|
|
@@ -4477,7 +4478,6 @@ export declare const refreshTokenSchema: z.ZodObject<{
|
|
|
4477
4478
|
last_user_agent: string;
|
|
4478
4479
|
last_asn: string;
|
|
4479
4480
|
};
|
|
4480
|
-
session_id: string;
|
|
4481
4481
|
resource_servers: {
|
|
4482
4482
|
audience: string;
|
|
4483
4483
|
scopes: string;
|
|
@@ -4491,6 +4491,7 @@ export declare const refreshTokenSchema: z.ZodObject<{
|
|
|
4491
4491
|
user_id: string;
|
|
4492
4492
|
id: string;
|
|
4493
4493
|
client_id: string;
|
|
4494
|
+
session_id: string;
|
|
4494
4495
|
device: {
|
|
4495
4496
|
last_ip: string;
|
|
4496
4497
|
initial_user_agent: string;
|
|
@@ -4499,7 +4500,6 @@ export declare const refreshTokenSchema: z.ZodObject<{
|
|
|
4499
4500
|
last_user_agent: string;
|
|
4500
4501
|
last_asn: string;
|
|
4501
4502
|
};
|
|
4502
|
-
session_id: string;
|
|
4503
4503
|
resource_servers: {
|
|
4504
4504
|
audience: string;
|
|
4505
4505
|
scopes: string;
|
|
@@ -4847,6 +4847,7 @@ export declare function init(config: AuthHeroConfig): {
|
|
|
4847
4847
|
user_id: string;
|
|
4848
4848
|
id: string;
|
|
4849
4849
|
client_id: string;
|
|
4850
|
+
session_id: string;
|
|
4850
4851
|
device: {
|
|
4851
4852
|
last_ip: string;
|
|
4852
4853
|
initial_user_agent: string;
|
|
@@ -4855,7 +4856,6 @@ export declare function init(config: AuthHeroConfig): {
|
|
|
4855
4856
|
last_user_agent: string;
|
|
4856
4857
|
last_asn: string;
|
|
4857
4858
|
};
|
|
4858
|
-
session_id: string;
|
|
4859
4859
|
resource_servers: {
|
|
4860
4860
|
audience: string;
|
|
4861
4861
|
scopes: string;
|
package/dist/authhero.mjs
CHANGED
|
@@ -1719,7 +1719,7 @@ const Pm = a.enum([
|
|
|
1719
1719
|
deleted_at: a.string().optional(),
|
|
1720
1720
|
ip: a.string().optional(),
|
|
1721
1721
|
useragent: a.string().optional(),
|
|
1722
|
-
|
|
1722
|
+
session_id: a.string().optional(),
|
|
1723
1723
|
authorization_url: a.string().optional()
|
|
1724
1724
|
}).openapi({
|
|
1725
1725
|
description: "This represents a login sesion"
|
|
@@ -5642,10 +5642,10 @@ async function Y0(t, e) {
|
|
|
5642
5642
|
}
|
|
5643
5643
|
);
|
|
5644
5644
|
}
|
|
5645
|
-
async function Ef(t, e) {
|
|
5646
|
-
const
|
|
5645
|
+
async function Ef(t, { user: e, client: n, loginSession: r }) {
|
|
5646
|
+
const i = await t.env.data.sessions.create(n.tenant.id, {
|
|
5647
5647
|
id: Ae(),
|
|
5648
|
-
user_id:
|
|
5648
|
+
user_id: e.user_id,
|
|
5649
5649
|
idle_expires_at: new Date(
|
|
5650
5650
|
Date.now() + Fs * 1e3
|
|
5651
5651
|
).toISOString(),
|
|
@@ -5658,14 +5658,15 @@ async function Ef(t, e) {
|
|
|
5658
5658
|
initial_asn: "",
|
|
5659
5659
|
last_asn: ""
|
|
5660
5660
|
},
|
|
5661
|
-
clients: [
|
|
5662
|
-
}), c =
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5661
|
+
clients: [n.id]
|
|
5662
|
+
}), { scope: s, audience: o } = r.authParams, c = s != null && s.split(" ").includes("offline_access") ? await Y0(t, {
|
|
5663
|
+
session_id: i.id,
|
|
5664
|
+
user: e,
|
|
5665
|
+
client: n,
|
|
5666
|
+
scope: s,
|
|
5667
|
+
audience: o
|
|
5667
5668
|
}) : void 0;
|
|
5668
|
-
return { ...
|
|
5669
|
+
return { ...i, refresh_token: c };
|
|
5669
5670
|
}
|
|
5670
5671
|
async function sn(t, e) {
|
|
5671
5672
|
var v;
|
|
@@ -5702,6 +5703,10 @@ async function sn(t, e) {
|
|
|
5702
5703
|
}
|
|
5703
5704
|
let c = e.refreshToken, l = e.sessionId, u = r;
|
|
5704
5705
|
if (!l) {
|
|
5706
|
+
if (!e.loginSession)
|
|
5707
|
+
throw new N(500, {
|
|
5708
|
+
message: "Login session not found"
|
|
5709
|
+
});
|
|
5705
5710
|
u = await ty(t, t.env.data)(
|
|
5706
5711
|
i.tenant.id,
|
|
5707
5712
|
r
|
|
@@ -5709,8 +5714,7 @@ async function sn(t, e) {
|
|
|
5709
5714
|
const f = await Ef(t, {
|
|
5710
5715
|
user: r,
|
|
5711
5716
|
client: i,
|
|
5712
|
-
|
|
5713
|
-
audience: n.audience
|
|
5717
|
+
loginSession: e.loginSession
|
|
5714
5718
|
});
|
|
5715
5719
|
l = f.id, c = (v = f.refresh_token) == null ? void 0 : v.id;
|
|
5716
5720
|
}
|
|
@@ -19237,7 +19241,10 @@ async function bb(t, e, n, r) {
|
|
|
19237
19241
|
data: {
|
|
19238
19242
|
vendorName: i.name,
|
|
19239
19243
|
logo: i.logo || "",
|
|
19240
|
-
|
|
19244
|
+
signupUrl: o,
|
|
19245
|
+
setPassword: oe("set_password", s),
|
|
19246
|
+
registerPasswordAccount: oe("register_password_account", s),
|
|
19247
|
+
clickToSignUpDescription: oe("click_to_sign_up_description", s),
|
|
19241
19248
|
supportUrl: i.support_url || "https://support.sesamy.com",
|
|
19242
19249
|
buttonColor: i.primary_color || "#7d68f4",
|
|
19243
19250
|
welcomeToYourAccount: oe("welcome_to_your_account", s),
|
|
@@ -19862,7 +19869,10 @@ async function Cb(t, e, n, r, i) {
|
|
|
19862
19869
|
const o = await s.data.codes.get(e, n, "ticket");
|
|
19863
19870
|
if (!o || o.used_at)
|
|
19864
19871
|
throw new N(403, { message: "Ticket not found" });
|
|
19865
|
-
const c = await s.data.loginSessions.get(
|
|
19872
|
+
const c = await s.data.loginSessions.get(
|
|
19873
|
+
e,
|
|
19874
|
+
o.login_id
|
|
19875
|
+
);
|
|
19866
19876
|
if (!c || !c.authParams.username)
|
|
19867
19877
|
throw new N(403, { message: "Session not found" });
|
|
19868
19878
|
const l = await s.data.clients.get(c.authParams.client_id);
|
|
@@ -19882,8 +19892,7 @@ async function Cb(t, e, n, r, i) {
|
|
|
19882
19892
|
const h = await Ef(t, {
|
|
19883
19893
|
user: p,
|
|
19884
19894
|
client: l,
|
|
19885
|
-
|
|
19886
|
-
audience: r.audience
|
|
19895
|
+
loginSession: c
|
|
19887
19896
|
});
|
|
19888
19897
|
return sn(t, {
|
|
19889
19898
|
authParams: {
|
|
@@ -23055,7 +23064,7 @@ const du = (t) => {
|
|
|
23055
23064
|
t,
|
|
23056
23065
|
i,
|
|
23057
23066
|
s.code_id,
|
|
23058
|
-
n.
|
|
23067
|
+
n.id
|
|
23059
23068
|
), t.redirect(`/u/pre-signup-sent?state=${e}`);
|
|
23060
23069
|
}
|
|
23061
23070
|
), G1 = (t) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "authhero",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.97.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"vite": "^5.4.11",
|
|
26
26
|
"vite-plugin-dts": "^4.3.0",
|
|
27
27
|
"vitest": "^2.1.5",
|
|
28
|
-
"@authhero/kysely-adapter": "^
|
|
28
|
+
"@authhero/kysely-adapter": "^10.0.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@peculiar/x509": "^1.12.3",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"i18next": "^24.2.0",
|
|
38
38
|
"nanoid": "^5.0.8",
|
|
39
39
|
"oslo": "^1.2.1",
|
|
40
|
-
"@authhero/adapter-interfaces": "^0.
|
|
40
|
+
"@authhero/adapter-interfaces": "^0.52.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@hono/zod-openapi": "^0.18.0",
|