W
Wasp-lang•2w ago
fustuk.

Zero length key (google auth) ??

Hey I get the following errors out of nowhere, and I have no clue how to debug this, any ideas how to proceed?
DOMException [DataError]: Zero-length key is not supported

at new DOMException (node:internal/per_context/domexception:53:5)

at __node_internal_ (node:internal/util:520:10)

at Object.hmacImportKey (node:internal/crypto/mac:103:15)

at SubtleCrypto.importKey (node:internal/crypto/webcrypto:631:10)

at HMAC.sign (file:///app/node_modules/oslo/dist/crypto/hmac.js:14:47)

at Module.createJWT (file:///app/node_modules/oslo/dist/jwt/index.js:42:53)

at createJWT (/app/.wasp/out/sdk/wasp/auth/jwt.ts:12:14)

at Object.createToken (/app/.wasp/out/sdk/wasp/server/auth/oauth/oneTimeCode.ts:12:12)

at finishOAuthFlowAndGetRedirectUri (/app/.wasp/build/server/src/auth/providers/oauth/user.ts:47:40)

at <anonymous> (/app/.wasp/build/server/src/auth/providers/oauth/handler.ts:97:31)

Unknown OAuth error: DOMException [DataError]: Zero-length key is not supported

at new DOMException (node:internal/per_context/domexception:53:5)

at __node_internal_ (node:internal/util:520:10)

at Object.hmacImportKey (node:internal/crypto/mac:103:15)

at SubtleCrypto.importKey (node:internal/crypto/webcrypto:631:10)

at HMAC.sign (file:///app/node_modules/oslo/dist/crypto/hmac.js:14:47)

at Module.createJWT (file:///app/node_modules/oslo/dist/jwt/index.js:42:53)

at createJWT (/app/.wasp/out/sdk/wasp/auth/jwt.ts:12:14)

at Object.createToken (/app/.wasp/out/sdk/wasp/server/auth/oauth/oneTimeCode.ts:12:12)

at finishOAuthFlowAndGetRedirectUri (/app/.wasp/build/server/src/auth/providers/oauth/user.ts:47:40)

at <anonymous> (/app/.wasp/build/server/src/auth/providers/oauth/handler.ts:97:31)
DOMException [DataError]: Zero-length key is not supported

at new DOMException (node:internal/per_context/domexception:53:5)

at __node_internal_ (node:internal/util:520:10)

at Object.hmacImportKey (node:internal/crypto/mac:103:15)

at SubtleCrypto.importKey (node:internal/crypto/webcrypto:631:10)

at HMAC.sign (file:///app/node_modules/oslo/dist/crypto/hmac.js:14:47)

at Module.createJWT (file:///app/node_modules/oslo/dist/jwt/index.js:42:53)

at createJWT (/app/.wasp/out/sdk/wasp/auth/jwt.ts:12:14)

at Object.createToken (/app/.wasp/out/sdk/wasp/server/auth/oauth/oneTimeCode.ts:12:12)

at finishOAuthFlowAndGetRedirectUri (/app/.wasp/build/server/src/auth/providers/oauth/user.ts:47:40)

at <anonymous> (/app/.wasp/build/server/src/auth/providers/oauth/handler.ts:97:31)

Unknown OAuth error: DOMException [DataError]: Zero-length key is not supported

at new DOMException (node:internal/per_context/domexception:53:5)

at __node_internal_ (node:internal/util:520:10)

at Object.hmacImportKey (node:internal/crypto/mac:103:15)

at SubtleCrypto.importKey (node:internal/crypto/webcrypto:631:10)

at HMAC.sign (file:///app/node_modules/oslo/dist/crypto/hmac.js:14:47)

at Module.createJWT (file:///app/node_modules/oslo/dist/jwt/index.js:42:53)

at createJWT (/app/.wasp/out/sdk/wasp/auth/jwt.ts:12:14)

at Object.createToken (/app/.wasp/out/sdk/wasp/server/auth/oauth/oneTimeCode.ts:12:12)

at finishOAuthFlowAndGetRedirectUri (/app/.wasp/build/server/src/auth/providers/oauth/user.ts:47:40)

at <anonymous> (/app/.wasp/build/server/src/auth/providers/oauth/handler.ts:97:31)
No description
No description
No description
4 Replies
kapa.ai
kapa.ai•2w ago
Hi @fustuk.. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The error message suggests that there might be an issue with the key used for Google OAuth, possibly being of zero length. In the Wasp setup for Google Auth, you should have added your GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET to the .env.server file at the root of your project. Please ensure that these values are correctly set and not empty. Here is how it should look like:
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
Source (https://wasp-lang.dev/docs/auth/social-auth/google#4-adding-environment-variables) If the problem persists, I would recommend reaching out to the Wasp community on their Discord server (https://discord.com/channels/686873244791210014/1215750573278629958) or opening an issue on their Github page (https://github.com/wasp-lang/wasp/issues). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @fustuk., I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
fustuk.
fustuk.•2w ago
fixed in, changed the domain without changing env values mb
miho
miho•2w ago
I'm glad it worked out đź‘Ť the error is not really helpful! So, you got it because you didn't update the env vars in the production setup?
fustuk.
fustuk.•2w ago
yes, WASP_SERVER_URL was pointing to another domain which was throwing CORS
Want results from more Discord servers?
Add your server