NextJS decode google auth id_token

16 views Asked by At

I have a project that connects to a socket. This socket is separated itself from nextjs project. In order for this socket project to be protected it should accept a token that is passed from nextjs and verify if a token is valid. However, upon decoding/verifying the token using jsonwebtoken with the GOOGLE_CLIENT_SECRET in env, it says a message that can be seen below (JsonWebTokenError: invalid algorithm).

Tried adding an option { algorithms: "ALL ALGO OPTIONS" } after "mySecret"

enter image description here

I also try other secret key like NEXTAUTH_SECRET and this one GOOGLE_CLIENT_ID. But still no luck. Anyone encounter this and how didyou solve it?

Thank you.

0

There are 0 answers