sst 3.0.1-17 → 3.0.1-19

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.
@@ -1,6 +1,5 @@
1
1
  import * as jose from "jose";
2
2
  import { Hono } from "hono/tiny";
3
- import { Resource } from "../resource.js";
4
3
  import { deleteCookie, getCookie, setCookie } from "hono/cookie";
5
4
  export class UnknownProviderError extends Error {
6
5
  provider;
@@ -36,7 +35,6 @@ export class InvalidSessionError extends Error {
36
35
  }
37
36
  }
38
37
  export function AuthHandler(input) {
39
- const auth = Resource[process.env.AUTH_ID];
40
38
  const app = new Hono();
41
39
  if (!input.callbacks.auth.error) {
42
40
  input.callbacks.auth.error = async (err) => {
@@ -50,12 +48,12 @@ export function AuthHandler(input) {
50
48
  }
51
49
  const options = {
52
50
  signing: {
53
- privateKey: jose.importPKCS8(auth.privateKey, "RS512"),
54
- publicKey: jose.importSPKI(auth.publicKey, "RS512"),
51
+ privateKey: jose.importPKCS8(process.env.AUTH_PRIVATE_KEY, "RS512"),
52
+ publicKey: jose.importSPKI(process.env.AUTH_PUBLIC_KEY, "RS512"),
55
53
  },
56
54
  encryption: {
57
- privateKey: jose.importPKCS8(auth.privateKey, "RSA-OAEP-512"),
58
- publicKey: jose.importSPKI(auth.publicKey, "RSA-OAEP-512"),
55
+ privateKey: jose.importPKCS8(process.env.AUTH_PRIVATE_KEY, "RSA-OAEP-512"),
56
+ publicKey: jose.importSPKI(process.env.AUTH_PUBLIC_KEY, "RSA-OAEP-512"),
59
57
  },
60
58
  algorithm: "RS512",
61
59
  async success(ctx, properties) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "sst",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
- "version": "3.0.1-17",
6
+ "version": "3.0.1-19",
7
7
  "main": "./dist/index.js",
8
8
  "exports": {
9
9
  ".": "./dist/index.js",