sst 2.2.1 → 2.2.2

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.
@@ -154,6 +154,14 @@ export function AuthHandler(input) {
154
154
  type,
155
155
  properties,
156
156
  });
157
+ useResponse().cookie({
158
+ key: "sst_auth_token",
159
+ value: token,
160
+ maxAge: 10 * 365 * 24 * 60 * 60,
161
+ secure: true,
162
+ sameSite: "None",
163
+ httpOnly: true,
164
+ });
157
165
  const { client_id, response_type, redirect_uri, state } = {
158
166
  ...useCookies(),
159
167
  ...useQueryParams(),
@@ -25,6 +25,13 @@ export function useSession() {
25
25
  return ctx;
26
26
  }
27
27
  function getPublicKey() {
28
+ // This is the auth function accessing the public key
29
+ if (process.env.AUTH_ID) {
30
+ // @ts-expect-error
31
+ const key = Config[process.env.AUTH_ID + "PublicKey"];
32
+ if (key)
33
+ return key;
34
+ }
28
35
  const [first] = Object.values(Auth);
29
36
  if (!first)
30
37
  throw new Error("No auth provider found. Did you forget to add one?");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sst",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "bin": {
5
5
  "sst": "cli/sst.js"
6
6
  },