Skip to content

Commit d38c659

Browse files
committed
Fix unused appliedMode param and deduplicate SESSION_COOKIE_NAME
- Remove unused appliedMode parameter from setDesktopServerExposurePreference and its callers/tests - Extract SESSION_COOKIE_NAME to Services/SessionCredentialService.ts and import it in both layer files to prevent silent divergence
1 parent b834685 commit d38c659

File tree

6 files changed

+4
-6
lines changed

6 files changed

+4
-6
lines changed

apps/desktop/src/desktopSettings.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ describe("desktopSettings", () => {
5050
},
5151
{
5252
requestedMode: "network-accessible",
53-
appliedMode: "local-only",
5453
},
5554
),
5655
).toEqual({

apps/desktop/src/desktopSettings.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export function setDesktopServerExposurePreference(
1414
settings: DesktopSettings,
1515
input: {
1616
readonly requestedMode: DesktopServerExposureMode;
17-
readonly appliedMode: DesktopServerExposureMode;
1817
},
1918
): DesktopSettings {
2019
const persistedMode = input.requestedMode;

apps/desktop/src/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ async function applyDesktopServerExposureMode(
237237
desktopServerExposureMode = exposure.mode;
238238
desktopSettings = setDesktopServerExposurePreference(desktopSettings, {
239239
requestedMode,
240-
appliedMode: exposure.mode,
241240
});
242241
backendBindHost = exposure.bindHost;
243242
backendHttpUrl = exposure.localHttpUrl;

apps/server/src/auth/Layers/ServerAuthPolicy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { Effect, Layer } from "effect";
33

44
import { ServerConfig } from "../../config.ts";
55
import { ServerAuthPolicy, type ServerAuthPolicyShape } from "../Services/ServerAuthPolicy.ts";
6-
7-
const SESSION_COOKIE_NAME = "t3_session";
6+
import { SESSION_COOKIE_NAME } from "../Services/SessionCredentialService.ts";
87

98
const isWildcardHost = (host: string | undefined): boolean =>
109
host === "0.0.0.0" || host === "::" || host === "[::]";

apps/server/src/auth/Layers/SessionCredentialService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { AuthSessionRepositoryLive } from "../../persistence/Layers/AuthSessions
66
import { AuthSessionRepository } from "../../persistence/Services/AuthSessions.ts";
77
import { ServerSecretStore } from "../Services/ServerSecretStore.ts";
88
import {
9+
SESSION_COOKIE_NAME,
910
SessionCredentialError,
1011
SessionCredentialService,
1112
type IssuedSession,
@@ -21,7 +22,6 @@ import {
2122
} from "../tokenCodec.ts";
2223

2324
const SIGNING_SECRET_NAME = "server-signing-key";
24-
const SESSION_COOKIE_NAME = "t3_session";
2525
const DEFAULT_SESSION_TTL = Duration.days(30);
2626
const DEFAULT_WEBSOCKET_TOKEN_TTL = Duration.minutes(5);
2727

apps/server/src/auth/Services/SessionCredentialService.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ export interface SessionCredentialServiceShape {
8181
readonly markDisconnected: (sessionId: AuthSessionId) => Effect.Effect<void, never>;
8282
}
8383

84+
export const SESSION_COOKIE_NAME = "t3_session";
85+
8486
export class SessionCredentialService extends ServiceMap.Service<
8587
SessionCredentialService,
8688
SessionCredentialServiceShape

0 commit comments

Comments
 (0)