sst 2.26.9 → 2.26.10

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.
@@ -56,6 +56,12 @@ export function AuthHandler(input) {
56
56
  };
57
57
  return ApiHandler(async (evt) => {
58
58
  const step = usePathParam("step");
59
+ if (!step) {
60
+ return (input.callbacks.index?.(evt) || {
61
+ statusCode: 404,
62
+ body: "Not found",
63
+ });
64
+ }
59
65
  if (step === "favicon.ico") {
60
66
  return {
61
67
  statusCode: 404,
@@ -238,6 +244,12 @@ export function AuthHandler(input) {
238
244
  });
239
245
  }
240
246
  if (response_type === "token" || response_type === "code") {
247
+ if (!redirect_uri) {
248
+ return ((await input.callbacks.auth.error?.(new UnknownStateError())) || {
249
+ statusCode: 400,
250
+ body: new UnknownStateError().message,
251
+ });
252
+ }
241
253
  const onSuccess = await input.callbacks.auth.success({
242
254
  provider,
243
255
  ...result.properties,
@@ -283,7 +295,7 @@ export function AuthHandler(input) {
283
295
  }, {
284
296
  expires: new Date(1),
285
297
  });
286
- const { client_id, redirect_uri, state } = useCookies();
298
+ const { client_id, state } = useCookies();
287
299
  if (response_type === "token") {
288
300
  const location = new URL(redirect_uri);
289
301
  location.hash = `access_token=${token}&state=${state || ""}`;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.26.9",
4
+ "version": "2.26.10",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },
package/stacks/synth.js CHANGED
@@ -4,17 +4,10 @@ import { useAWSProvider, useSTSIdentity } from "../credentials.js";
4
4
  import * as contextproviders from "sst-aws-cdk/lib/context-providers/index.js";
5
5
  import path from "path";
6
6
  import { VisibleError } from "../error.js";
7
+ import fs from "fs/promises";
7
8
  export async function synth(opts) {
8
9
  Logger.debug("Synthesizing stacks...");
9
10
  const { App } = await import("../constructs/App.js");
10
- const { useNodeHandler } = await import("../runtime/handlers/node.js");
11
- const { useGoHandler } = await import("../runtime/handlers/go.js");
12
- const { useContainerHandler } = await import("../runtime/handlers/container.js");
13
- const { useRustHandler } = await import("../runtime/handlers/rust.js");
14
- const { usePythonHandler } = await import("../runtime/handlers/python.js");
15
- const { useJavaHandler } = await import("../runtime/handlers/java.js");
16
- if (opts.mode !== "remove") {
17
- }
18
11
  const cxapi = await import("@aws-cdk/cx-api");
19
12
  const { Configuration } = await import("sst-aws-cdk/lib/settings.js");
20
13
  const project = useProject();
@@ -23,6 +16,8 @@ export async function synth(opts) {
23
16
  ...opts,
24
17
  buildDir: opts.buildDir || path.join(project.paths.out, "dist"),
25
18
  };
19
+ await fs.rm(opts.buildDir, { recursive: true, force: true });
20
+ await fs.mkdir(opts.buildDir, { recursive: true });
26
21
  /*
27
22
  console.log(JSON.stringify(cfg.context));
28
23
  const executable = new CloudExecutable({