feat(server): add reusable auth token for dev worktrees (#8606)
This commit is contained in:
1 parent
564719165e
commit
3b75e607eb
20 files changed
+1178
-43
No files matched your search
@@ -152,6 +152,27 @@ it.layer(NodeServices.layer)("dev-runner", (it) => {
|
||||
});
|
||||
|
||||
describe("createDevRunnerEnv", () => {
|
||||
it.effect("forwards the reusable auth token to web dev and removes it for desktop", () =>
|
||||
Effect.gen(function* () {
|
||||
const input = {
|
||||
baseEnv: { T3CODE_DEV_AUTH_TOKEN: "reusable-dev-auth-token-that-is-long-enough" },
|
||||
serverOffset: 0,
|
||||
webOffset: 0,
|
||||
t3Home: undefined,
|
||||
browser: undefined,
|
||||
autoBootstrapProjectFromCwd: undefined,
|
||||
logWebSocketEvents: undefined,
|
||||
host: undefined,
|
||||
port: undefined,
|
||||
devUrl: undefined,
|
||||
} as const;
|
||||
const web = yield* createDevRunnerEnv({ ...input, mode: "dev" });
|
||||
const desktop = yield* createDevRunnerEnv({ ...input, mode: "dev:desktop" });
|
||||
|
||||
assert.equal(web.T3CODE_DEV_AUTH_TOKEN, input.baseEnv.T3CODE_DEV_AUTH_TOKEN);
|
||||
assert.equal(desktop.T3CODE_DEV_AUTH_TOKEN, undefined);
|
||||
}),
|
||||
);
|
||||
it.effect("leaves the shared home implicit and disables browser auto-open", () =>
|
||||
Effect.gen(function* () {
|
||||
const env = yield* createDevRunnerEnv({
|
||||
|
||||
@@ -388,6 +388,7 @@ export function createDevRunnerEnv({
|
||||
delete output.T3CODE_MODE;
|
||||
delete output.T3CODE_NO_BROWSER;
|
||||
delete output.T3CODE_HOST;
|
||||
delete output.T3CODE_DEV_AUTH_TOKEN;
|
||||
}
|
||||
|
||||
if (!isDesktopMode && host !== undefined) {
|
||||
|
||||
Reference in new issue
Block a user