sst 2.17.5 → 2.17.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.
|
@@ -20,8 +20,10 @@ export function CodeAdapter(config) {
|
|
|
20
20
|
delete claims["response_type"];
|
|
21
21
|
delete claims["provider"];
|
|
22
22
|
useResponse().cookies({
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
authorization: encrypt(JSON.stringify({
|
|
24
|
+
claims,
|
|
25
|
+
code,
|
|
26
|
+
})),
|
|
25
27
|
}, {
|
|
26
28
|
maxAge: 3600,
|
|
27
29
|
secure: true,
|
|
@@ -34,31 +36,28 @@ export function CodeAdapter(config) {
|
|
|
34
36
|
};
|
|
35
37
|
}
|
|
36
38
|
if (step === "callback") {
|
|
37
|
-
const code = decrypt(useCookie("
|
|
38
|
-
const claims = decrypt(useCookie("sst_claims"));
|
|
39
|
+
const { code, claims } = JSON.parse(decrypt(useCookie("authorization")));
|
|
39
40
|
if (!code || !claims) {
|
|
40
41
|
return {
|
|
41
42
|
type: "error",
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
45
|
const compare = useQueryParam("code");
|
|
45
|
-
const parsedClaims = JSON.parse(claims);
|
|
46
46
|
if (code !== compare) {
|
|
47
47
|
return {
|
|
48
48
|
type: "step",
|
|
49
|
-
properties: await config.onCodeInvalid(code,
|
|
49
|
+
properties: await config.onCodeInvalid(code, claims),
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
useResponse().cookies({
|
|
53
|
-
|
|
54
|
-
sst_claims: "",
|
|
53
|
+
authorization: "",
|
|
55
54
|
}, {
|
|
56
55
|
expires: new Date(1),
|
|
57
56
|
});
|
|
58
57
|
return {
|
|
59
58
|
type: "success",
|
|
60
59
|
properties: {
|
|
61
|
-
claims:
|
|
60
|
+
claims: claims,
|
|
62
61
|
},
|
|
63
62
|
};
|
|
64
63
|
}
|