sst 2.13.4 → 2.13.6

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.
@@ -324,6 +324,7 @@ export declare class StaticSite extends Construct implements SSTConstruct {
324
324
  path: string;
325
325
  environment: Record<string, string>;
326
326
  customDomainUrl: string | undefined;
327
+ url: string | undefined;
327
328
  };
328
329
  };
329
330
  /** @internal */
@@ -138,6 +138,7 @@ export class StaticSite extends Construct {
138
138
  path: this.props.path,
139
139
  environment: this.props.environment || {},
140
140
  customDomainUrl: this.customDomainUrl,
141
+ url: this.url,
141
142
  },
142
143
  };
143
144
  }
@@ -5,12 +5,12 @@ export declare function CodeAdapter(config: {
5
5
  }): () => Promise<{
6
6
  type: "step";
7
7
  properties: APIGatewayProxyStructuredResultV2;
8
- } | {
9
- type: "error";
10
- properties?: undefined;
11
8
  } | {
12
9
  type: "success";
13
10
  properties: {
14
11
  claims: any;
15
12
  };
13
+ } | {
14
+ type: "error";
15
+ properties?: undefined;
16
16
  }>;
@@ -34,17 +34,33 @@ export function CodeAdapter(config) {
34
34
  };
35
35
  }
36
36
  if (step === "callback") {
37
+ const error = new URL(useQueryParam("error") || "");
38
+ const qp = new URLSearchParams(error.search);
39
+ qp.set("error", "invalid_code");
40
+ error.search = qp.toString();
37
41
  const code = decrypt(useCookie("sst_code"));
38
42
  const claims = decrypt(useCookie("sst_claims"));
39
43
  if (!code || !claims) {
40
44
  return {
41
- type: "error",
45
+ type: "step",
46
+ properties: {
47
+ statusCode: 302,
48
+ headers: {
49
+ location: error.toString(),
50
+ },
51
+ },
42
52
  };
43
53
  }
44
54
  const compare = useQueryParam("code");
45
55
  if (code !== compare) {
46
56
  return {
47
- type: "error",
57
+ type: "step",
58
+ properties: {
59
+ statusCode: 302,
60
+ headers: {
61
+ location: error.toString(),
62
+ },
63
+ },
48
64
  };
49
65
  }
50
66
  useResponse().cookies({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.13.4",
4
+ "version": "2.13.6",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },