@scalemule/nextjs 0.1.15 → 0.1.17
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/{ledvery-C9vvhlUn.d.mts → ledvery-CxPzZpxP.d.mts} +1 -0
- package/dist/{ledvery-C9vvhlUn.d.ts → ledvery-CxPzZpxP.d.ts} +1 -0
- package/dist/server/index.d.mts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +18 -4
- package/dist/server/index.mjs +18 -4
- package/dist/server/ledvery.d.mts +1 -1
- package/dist/server/ledvery.d.ts +1 -1
- package/dist/server/ledvery.js +18 -4
- package/dist/server/ledvery.mjs +18 -4
- package/package.json +1 -1
package/dist/server/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { S as ServerConfig } from '../webhook-handler-CUp_A0_p.mjs';
|
|
2
2
|
export { a as ScaleMuleServer, V as VideoFailedEvent, b as VideoReadyEvent, c as VideoTranscodedEvent, d as VideoUploadedEvent, W as WebhookEvent, e as WebhookRoutesConfig, f as createServerClient, g as createWebhookHandler, h as createWebhookRoutes, p as parseWebhookEvent, r as registerVideoWebhook, i as resolveGatewayUrl, v as verifyWebhookSignature } from '../webhook-handler-CUp_A0_p.mjs';
|
|
3
3
|
import { p as ClientContext, A as ApiError } from '../index-DTWyUcyd.mjs';
|
|
4
|
-
export { L as LedveryRoutesConfig, a as LedverySessionData, S as SM_LEDVERY_ACCESS_TOKEN_COOKIE, b as SM_LEDVERY_ID_TOKEN_COOKIE, c as SM_LEDVERY_NONCE_COOKIE, d as SM_LEDVERY_PKCE_VERIFIER_COOKIE, e as SM_LEDVERY_STATE_COOKIE, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-
|
|
4
|
+
export { L as LedveryRoutesConfig, a as LedverySessionData, S as SM_LEDVERY_ACCESS_TOKEN_COOKIE, b as SM_LEDVERY_ID_TOKEN_COOKIE, c as SM_LEDVERY_NONCE_COOKIE, d as SM_LEDVERY_PKCE_VERIFIER_COOKIE, e as SM_LEDVERY_STATE_COOKIE, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-CxPzZpxP.mjs';
|
|
5
5
|
import { NextRequest, NextResponse } from 'next/server';
|
|
6
6
|
import '@scalemule/money';
|
|
7
7
|
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { S as ServerConfig } from '../webhook-handler-C07AK4QB.js';
|
|
2
2
|
export { a as ScaleMuleServer, V as VideoFailedEvent, b as VideoReadyEvent, c as VideoTranscodedEvent, d as VideoUploadedEvent, W as WebhookEvent, e as WebhookRoutesConfig, f as createServerClient, g as createWebhookHandler, h as createWebhookRoutes, p as parseWebhookEvent, r as registerVideoWebhook, i as resolveGatewayUrl, v as verifyWebhookSignature } from '../webhook-handler-C07AK4QB.js';
|
|
3
3
|
import { p as ClientContext, A as ApiError } from '../index-DTWyUcyd.js';
|
|
4
|
-
export { L as LedveryRoutesConfig, a as LedverySessionData, S as SM_LEDVERY_ACCESS_TOKEN_COOKIE, b as SM_LEDVERY_ID_TOKEN_COOKIE, c as SM_LEDVERY_NONCE_COOKIE, d as SM_LEDVERY_PKCE_VERIFIER_COOKIE, e as SM_LEDVERY_STATE_COOKIE, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-
|
|
4
|
+
export { L as LedveryRoutesConfig, a as LedverySessionData, S as SM_LEDVERY_ACCESS_TOKEN_COOKIE, b as SM_LEDVERY_ID_TOKEN_COOKIE, c as SM_LEDVERY_NONCE_COOKIE, d as SM_LEDVERY_PKCE_VERIFIER_COOKIE, e as SM_LEDVERY_STATE_COOKIE, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-CxPzZpxP.js';
|
|
5
5
|
import { NextRequest, NextResponse } from 'next/server';
|
|
6
6
|
import '@scalemule/money';
|
|
7
7
|
|
package/dist/server/index.js
CHANGED
|
@@ -3832,6 +3832,7 @@ function setLedverySession(response, session, opts) {
|
|
|
3832
3832
|
if (opts?.cookies?.sameSite) cookieOpts.sameSite = opts.cookies.sameSite;
|
|
3833
3833
|
if (opts?.cookies?.secure !== void 0) cookieOpts.secure = opts.cookies.secure;
|
|
3834
3834
|
const sessionPayload = JSON.stringify({
|
|
3835
|
+
idToken: session.idToken,
|
|
3835
3836
|
claims: session.claims,
|
|
3836
3837
|
expiresAt: session.expiresAt
|
|
3837
3838
|
});
|
|
@@ -3846,8 +3847,7 @@ function getLedverySession(request) {
|
|
|
3846
3847
|
try {
|
|
3847
3848
|
const parsed = JSON.parse(raw);
|
|
3848
3849
|
return {
|
|
3849
|
-
idToken: "",
|
|
3850
|
-
// not stored in cookie for size
|
|
3850
|
+
idToken: parsed.idToken || "",
|
|
3851
3851
|
claims: parsed.claims,
|
|
3852
3852
|
expiresAt: parsed.expiresAt
|
|
3853
3853
|
};
|
|
@@ -4052,7 +4052,21 @@ function createLedveryRoutes(config) {
|
|
|
4052
4052
|
{ status: 200, headers: { "Content-Type": "application/json" } }
|
|
4053
4053
|
);
|
|
4054
4054
|
}
|
|
4055
|
-
function handleLogout(
|
|
4055
|
+
function handleLogout(request) {
|
|
4056
|
+
const session = getLedverySession(request);
|
|
4057
|
+
const idToken = session?.idToken;
|
|
4058
|
+
if (config.gatewayUrl) {
|
|
4059
|
+
let rpLogoutUrl = `${config.gatewayUrl}/v1/auth/oauth/ledvery/logout?post_logout_redirect_uri=${encodeURIComponent(postLogoutRedirect)}`;
|
|
4060
|
+
if (idToken) {
|
|
4061
|
+
rpLogoutUrl += `&id_token_hint=${encodeURIComponent(idToken)}`;
|
|
4062
|
+
}
|
|
4063
|
+
const response2 = new Response(null, {
|
|
4064
|
+
status: 302,
|
|
4065
|
+
headers: { Location: rpLogoutUrl }
|
|
4066
|
+
});
|
|
4067
|
+
clearLedverySession(response2);
|
|
4068
|
+
return response2;
|
|
4069
|
+
}
|
|
4056
4070
|
const response = new Response(null, {
|
|
4057
4071
|
status: 302,
|
|
4058
4072
|
headers: { Location: postLogoutRedirect }
|
|
@@ -4071,7 +4085,7 @@ function createLedveryRoutes(config) {
|
|
|
4071
4085
|
case "session":
|
|
4072
4086
|
return handleSession(request);
|
|
4073
4087
|
case "logout":
|
|
4074
|
-
return handleLogout();
|
|
4088
|
+
return handleLogout(request);
|
|
4075
4089
|
default:
|
|
4076
4090
|
return new Response(
|
|
4077
4091
|
JSON.stringify({ error: "not_found", message: `Unknown Ledvery route: ${action}` }),
|
package/dist/server/index.mjs
CHANGED
|
@@ -3830,6 +3830,7 @@ function setLedverySession(response, session, opts) {
|
|
|
3830
3830
|
if (opts?.cookies?.sameSite) cookieOpts.sameSite = opts.cookies.sameSite;
|
|
3831
3831
|
if (opts?.cookies?.secure !== void 0) cookieOpts.secure = opts.cookies.secure;
|
|
3832
3832
|
const sessionPayload = JSON.stringify({
|
|
3833
|
+
idToken: session.idToken,
|
|
3833
3834
|
claims: session.claims,
|
|
3834
3835
|
expiresAt: session.expiresAt
|
|
3835
3836
|
});
|
|
@@ -3844,8 +3845,7 @@ function getLedverySession(request) {
|
|
|
3844
3845
|
try {
|
|
3845
3846
|
const parsed = JSON.parse(raw);
|
|
3846
3847
|
return {
|
|
3847
|
-
idToken: "",
|
|
3848
|
-
// not stored in cookie for size
|
|
3848
|
+
idToken: parsed.idToken || "",
|
|
3849
3849
|
claims: parsed.claims,
|
|
3850
3850
|
expiresAt: parsed.expiresAt
|
|
3851
3851
|
};
|
|
@@ -4050,7 +4050,21 @@ function createLedveryRoutes(config) {
|
|
|
4050
4050
|
{ status: 200, headers: { "Content-Type": "application/json" } }
|
|
4051
4051
|
);
|
|
4052
4052
|
}
|
|
4053
|
-
function handleLogout(
|
|
4053
|
+
function handleLogout(request) {
|
|
4054
|
+
const session = getLedverySession(request);
|
|
4055
|
+
const idToken = session?.idToken;
|
|
4056
|
+
if (config.gatewayUrl) {
|
|
4057
|
+
let rpLogoutUrl = `${config.gatewayUrl}/v1/auth/oauth/ledvery/logout?post_logout_redirect_uri=${encodeURIComponent(postLogoutRedirect)}`;
|
|
4058
|
+
if (idToken) {
|
|
4059
|
+
rpLogoutUrl += `&id_token_hint=${encodeURIComponent(idToken)}`;
|
|
4060
|
+
}
|
|
4061
|
+
const response2 = new Response(null, {
|
|
4062
|
+
status: 302,
|
|
4063
|
+
headers: { Location: rpLogoutUrl }
|
|
4064
|
+
});
|
|
4065
|
+
clearLedverySession(response2);
|
|
4066
|
+
return response2;
|
|
4067
|
+
}
|
|
4054
4068
|
const response = new Response(null, {
|
|
4055
4069
|
status: 302,
|
|
4056
4070
|
headers: { Location: postLogoutRedirect }
|
|
@@ -4069,7 +4083,7 @@ function createLedveryRoutes(config) {
|
|
|
4069
4083
|
case "session":
|
|
4070
4084
|
return handleSession(request);
|
|
4071
4085
|
case "logout":
|
|
4072
|
-
return handleLogout();
|
|
4086
|
+
return handleLogout(request);
|
|
4073
4087
|
default:
|
|
4074
4088
|
return new Response(
|
|
4075
4089
|
JSON.stringify({ error: "not_found", message: `Unknown Ledvery route: ${action}` }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { L as LedveryRoutesConfig, a as LedverySessionData, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-
|
|
1
|
+
export { L as LedveryRoutesConfig, a as LedverySessionData, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-CxPzZpxP.mjs';
|
package/dist/server/ledvery.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { L as LedveryRoutesConfig, a as LedverySessionData, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-
|
|
1
|
+
export { L as LedveryRoutesConfig, a as LedverySessionData, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-CxPzZpxP.js';
|
package/dist/server/ledvery.js
CHANGED
|
@@ -66,6 +66,7 @@ function setLedverySession(response, session, opts) {
|
|
|
66
66
|
if (opts?.cookies?.sameSite) cookieOpts.sameSite = opts.cookies.sameSite;
|
|
67
67
|
if (opts?.cookies?.secure !== void 0) cookieOpts.secure = opts.cookies.secure;
|
|
68
68
|
const sessionPayload = JSON.stringify({
|
|
69
|
+
idToken: session.idToken,
|
|
69
70
|
claims: session.claims,
|
|
70
71
|
expiresAt: session.expiresAt
|
|
71
72
|
});
|
|
@@ -80,8 +81,7 @@ function getLedverySession(request) {
|
|
|
80
81
|
try {
|
|
81
82
|
const parsed = JSON.parse(raw);
|
|
82
83
|
return {
|
|
83
|
-
idToken: "",
|
|
84
|
-
// not stored in cookie for size
|
|
84
|
+
idToken: parsed.idToken || "",
|
|
85
85
|
claims: parsed.claims,
|
|
86
86
|
expiresAt: parsed.expiresAt
|
|
87
87
|
};
|
|
@@ -280,7 +280,21 @@ function createLedveryRoutes(config) {
|
|
|
280
280
|
{ status: 200, headers: { "Content-Type": "application/json" } }
|
|
281
281
|
);
|
|
282
282
|
}
|
|
283
|
-
function handleLogout(
|
|
283
|
+
function handleLogout(request) {
|
|
284
|
+
const session = getLedverySession(request);
|
|
285
|
+
const idToken = session?.idToken;
|
|
286
|
+
if (config.gatewayUrl) {
|
|
287
|
+
let rpLogoutUrl = `${config.gatewayUrl}/v1/auth/oauth/ledvery/logout?post_logout_redirect_uri=${encodeURIComponent(postLogoutRedirect)}`;
|
|
288
|
+
if (idToken) {
|
|
289
|
+
rpLogoutUrl += `&id_token_hint=${encodeURIComponent(idToken)}`;
|
|
290
|
+
}
|
|
291
|
+
const response2 = new Response(null, {
|
|
292
|
+
status: 302,
|
|
293
|
+
headers: { Location: rpLogoutUrl }
|
|
294
|
+
});
|
|
295
|
+
clearLedverySession(response2);
|
|
296
|
+
return response2;
|
|
297
|
+
}
|
|
284
298
|
const response = new Response(null, {
|
|
285
299
|
status: 302,
|
|
286
300
|
headers: { Location: postLogoutRedirect }
|
|
@@ -299,7 +313,7 @@ function createLedveryRoutes(config) {
|
|
|
299
313
|
case "session":
|
|
300
314
|
return handleSession(request);
|
|
301
315
|
case "logout":
|
|
302
|
-
return handleLogout();
|
|
316
|
+
return handleLogout(request);
|
|
303
317
|
default:
|
|
304
318
|
return new Response(
|
|
305
319
|
JSON.stringify({ error: "not_found", message: `Unknown Ledvery route: ${action}` }),
|
package/dist/server/ledvery.mjs
CHANGED
|
@@ -64,6 +64,7 @@ function setLedverySession(response, session, opts) {
|
|
|
64
64
|
if (opts?.cookies?.sameSite) cookieOpts.sameSite = opts.cookies.sameSite;
|
|
65
65
|
if (opts?.cookies?.secure !== void 0) cookieOpts.secure = opts.cookies.secure;
|
|
66
66
|
const sessionPayload = JSON.stringify({
|
|
67
|
+
idToken: session.idToken,
|
|
67
68
|
claims: session.claims,
|
|
68
69
|
expiresAt: session.expiresAt
|
|
69
70
|
});
|
|
@@ -78,8 +79,7 @@ function getLedverySession(request) {
|
|
|
78
79
|
try {
|
|
79
80
|
const parsed = JSON.parse(raw);
|
|
80
81
|
return {
|
|
81
|
-
idToken: "",
|
|
82
|
-
// not stored in cookie for size
|
|
82
|
+
idToken: parsed.idToken || "",
|
|
83
83
|
claims: parsed.claims,
|
|
84
84
|
expiresAt: parsed.expiresAt
|
|
85
85
|
};
|
|
@@ -278,7 +278,21 @@ function createLedveryRoutes(config) {
|
|
|
278
278
|
{ status: 200, headers: { "Content-Type": "application/json" } }
|
|
279
279
|
);
|
|
280
280
|
}
|
|
281
|
-
function handleLogout(
|
|
281
|
+
function handleLogout(request) {
|
|
282
|
+
const session = getLedverySession(request);
|
|
283
|
+
const idToken = session?.idToken;
|
|
284
|
+
if (config.gatewayUrl) {
|
|
285
|
+
let rpLogoutUrl = `${config.gatewayUrl}/v1/auth/oauth/ledvery/logout?post_logout_redirect_uri=${encodeURIComponent(postLogoutRedirect)}`;
|
|
286
|
+
if (idToken) {
|
|
287
|
+
rpLogoutUrl += `&id_token_hint=${encodeURIComponent(idToken)}`;
|
|
288
|
+
}
|
|
289
|
+
const response2 = new Response(null, {
|
|
290
|
+
status: 302,
|
|
291
|
+
headers: { Location: rpLogoutUrl }
|
|
292
|
+
});
|
|
293
|
+
clearLedverySession(response2);
|
|
294
|
+
return response2;
|
|
295
|
+
}
|
|
282
296
|
const response = new Response(null, {
|
|
283
297
|
status: 302,
|
|
284
298
|
headers: { Location: postLogoutRedirect }
|
|
@@ -297,7 +311,7 @@ function createLedveryRoutes(config) {
|
|
|
297
311
|
case "session":
|
|
298
312
|
return handleSession(request);
|
|
299
313
|
case "logout":
|
|
300
|
-
return handleLogout();
|
|
314
|
+
return handleLogout(request);
|
|
301
315
|
default:
|
|
302
316
|
return new Response(
|
|
303
317
|
JSON.stringify({ error: "not_found", message: `Unknown Ledvery route: ${action}` }),
|
package/package.json
CHANGED