@zodic/shared 0.0.390 → 0.0.391
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/package.json +1 -1
- package/types/scopes/cloudflare.ts +5 -1
- package/utils/index.ts +3 -1
package/package.json
CHANGED
|
@@ -12,6 +12,10 @@ import type { Container } from 'inversify';
|
|
|
12
12
|
|
|
13
13
|
export type Environment = 'dev' | 'stg' | 'prod';
|
|
14
14
|
|
|
15
|
+
export type SECRETS_STORE_SECRET = {
|
|
16
|
+
get: () => Promise<string>;
|
|
17
|
+
};
|
|
18
|
+
|
|
15
19
|
export type CentralBindings = {
|
|
16
20
|
TEST_IMAGES_BUCKET: R2Bucket;
|
|
17
21
|
PHOTOS_BUCKET: R2Bucket;
|
|
@@ -51,7 +55,7 @@ export type CentralBindings = {
|
|
|
51
55
|
AI: Ai;
|
|
52
56
|
DB: D1Database;
|
|
53
57
|
DRIZZLE: DrizzleD1Database;
|
|
54
|
-
JWT_SECRET:
|
|
58
|
+
JWT_SECRET: SECRETS_STORE_SECRET;
|
|
55
59
|
CLOUDFLARE_DATABASE_ID: string;
|
|
56
60
|
CLOUDFLARE_D1_TOKEN: string;
|
|
57
61
|
CLOUDFLARE_ACCOUNT_ID: string;
|
package/utils/index.ts
CHANGED
|
@@ -12,7 +12,9 @@ export const verifyToken = async (
|
|
|
12
12
|
c: AuthCtx,
|
|
13
13
|
token: string
|
|
14
14
|
): Promise<{ userId: string; email?: string; roles?: string[] }> => {
|
|
15
|
-
const jwtSecret = c.env.JWT_SECRET;
|
|
15
|
+
const jwtSecret = await c.env.JWT_SECRET.get();
|
|
16
|
+
console.log('JWT_SECRET: ', c.env.JWT_SECRET)
|
|
17
|
+
console.log('JWT_SECRET.get(): ', jwtSecret)
|
|
16
18
|
const audience = c.env.GOOGLE_OAUTH_CLIENT_ID;
|
|
17
19
|
const issuer = 'https://accounts.google.com';
|
|
18
20
|
|