@scalemule/nextjs 0.1.15 → 0.1.16

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.
@@ -29,6 +29,7 @@ interface LedveryRoutesConfig {
29
29
  cookies?: SessionCookieOverrides;
30
30
  storeAccessToken?: boolean;
31
31
  fetch?: typeof fetch;
32
+ gatewayUrl?: string;
32
33
  }
33
34
  type RouteHandler = (request: Request, context: {
34
35
  params: Promise<{
@@ -29,6 +29,7 @@ interface LedveryRoutesConfig {
29
29
  cookies?: SessionCookieOverrides;
30
30
  storeAccessToken?: boolean;
31
31
  fetch?: typeof fetch;
32
+ gatewayUrl?: string;
32
33
  }
33
34
  type RouteHandler = (request: Request, context: {
34
35
  params: Promise<{
@@ -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-C9vvhlUn.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-CxPzZpxP.mjs';
5
5
  import { NextRequest, NextResponse } from 'next/server';
6
6
  import '@scalemule/money';
7
7
 
@@ -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-C9vvhlUn.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-CxPzZpxP.js';
5
5
  import { NextRequest, NextResponse } from 'next/server';
6
6
  import '@scalemule/money';
7
7
 
@@ -4053,6 +4053,15 @@ function createLedveryRoutes(config) {
4053
4053
  );
4054
4054
  }
4055
4055
  function handleLogout(_request) {
4056
+ if (config.gatewayUrl) {
4057
+ const rpLogoutUrl = `${config.gatewayUrl}/v1/auth/oauth/ledvery/logout?post_logout_redirect_uri=${encodeURIComponent(postLogoutRedirect)}`;
4058
+ const response2 = new Response(null, {
4059
+ status: 302,
4060
+ headers: { Location: rpLogoutUrl }
4061
+ });
4062
+ clearLedverySession(response2);
4063
+ return response2;
4064
+ }
4056
4065
  const response = new Response(null, {
4057
4066
  status: 302,
4058
4067
  headers: { Location: postLogoutRedirect }
@@ -4051,6 +4051,15 @@ function createLedveryRoutes(config) {
4051
4051
  );
4052
4052
  }
4053
4053
  function handleLogout(_request) {
4054
+ if (config.gatewayUrl) {
4055
+ const rpLogoutUrl = `${config.gatewayUrl}/v1/auth/oauth/ledvery/logout?post_logout_redirect_uri=${encodeURIComponent(postLogoutRedirect)}`;
4056
+ const response2 = new Response(null, {
4057
+ status: 302,
4058
+ headers: { Location: rpLogoutUrl }
4059
+ });
4060
+ clearLedverySession(response2);
4061
+ return response2;
4062
+ }
4054
4063
  const response = new Response(null, {
4055
4064
  status: 302,
4056
4065
  headers: { Location: postLogoutRedirect }
@@ -1 +1 @@
1
- export { L as LedveryRoutesConfig, a as LedverySessionData, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-C9vvhlUn.mjs';
1
+ export { L as LedveryRoutesConfig, a as LedverySessionData, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-CxPzZpxP.mjs';
@@ -1 +1 @@
1
- export { L as LedveryRoutesConfig, a as LedverySessionData, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-C9vvhlUn.js';
1
+ export { L as LedveryRoutesConfig, a as LedverySessionData, f as createLedveryRoutes, g as getLedverySession } from '../ledvery-CxPzZpxP.js';
@@ -281,6 +281,15 @@ function createLedveryRoutes(config) {
281
281
  );
282
282
  }
283
283
  function handleLogout(_request) {
284
+ if (config.gatewayUrl) {
285
+ const rpLogoutUrl = `${config.gatewayUrl}/v1/auth/oauth/ledvery/logout?post_logout_redirect_uri=${encodeURIComponent(postLogoutRedirect)}`;
286
+ const response2 = new Response(null, {
287
+ status: 302,
288
+ headers: { Location: rpLogoutUrl }
289
+ });
290
+ clearLedverySession(response2);
291
+ return response2;
292
+ }
284
293
  const response = new Response(null, {
285
294
  status: 302,
286
295
  headers: { Location: postLogoutRedirect }
@@ -279,6 +279,15 @@ function createLedveryRoutes(config) {
279
279
  );
280
280
  }
281
281
  function handleLogout(_request) {
282
+ if (config.gatewayUrl) {
283
+ const rpLogoutUrl = `${config.gatewayUrl}/v1/auth/oauth/ledvery/logout?post_logout_redirect_uri=${encodeURIComponent(postLogoutRedirect)}`;
284
+ const response2 = new Response(null, {
285
+ status: 302,
286
+ headers: { Location: rpLogoutUrl }
287
+ });
288
+ clearLedverySession(response2);
289
+ return response2;
290
+ }
282
291
  const response = new Response(null, {
283
292
  status: 302,
284
293
  headers: { Location: postLogoutRedirect }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalemule/nextjs",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "ScaleMule SDK for Next.js applications - authentication, storage, and user management",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",