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.
package/constructs/StaticSite.js
CHANGED
|
@@ -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: "
|
|
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: "
|
|
57
|
+
type: "step",
|
|
58
|
+
properties: {
|
|
59
|
+
statusCode: 302,
|
|
60
|
+
headers: {
|
|
61
|
+
location: error.toString(),
|
|
62
|
+
},
|
|
63
|
+
},
|
|
48
64
|
};
|
|
49
65
|
}
|
|
50
66
|
useResponse().cookies({
|