Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having an error and no messeges recieved #11

Open
l3op opened this issue Dec 19, 2024 · 3 comments
Open

Having an error and no messeges recieved #11

l3op opened this issue Dec 19, 2024 · 3 comments

Comments

@l3op
Copy link

l3op commented Dec 19, 2024

Hello there,

I tried to run the project on my localhost and i had some issue. For the client side working just fine. i set Auth0 environment variables and i'm able to login and register. Chat are not received or sent . Like it's pending.

image

Server side i noticed some error saying:

[1] [nodemon] starting `node dist/index.js dist/index.js`
[1] Server is running in port 3000
[1] GET /api/users/metadata 304 1850.953 ms - -
[1] JsonWebTokenError: secret or public key must be provided
[1]     at C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\jsonwebtoken\verify.js:113:19
[1]     at getSecret (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\jsonwebtoken\verify.js:97:14)
[1]     at module.exports [as verify] (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\jsonwebtoken\verify.js:101:10)
[1]     at authSocketMiddleware (file:///C:/Users/MSI/Desktop/l3op/chatify/server/dist/src/middlewares/auth.js:17:29)
[1]     at Array.<anonymous> (file:///C:/Users/MSI/Desktop/l3op/chatify/server/dist/src/router/socket.js:10:39)
[1]     at run (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\socket.io\dist\namespace.js:124:19)
[1]     at Namespace.run (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\socket.io\dist\namespace.js:135:9)
[1]     at Namespace._add (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\socket.io\dist\namespace.js:211:14)
[1]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[1] GET /api/users/metadata 304 1026.164 ms - -
[1] JsonWebTokenError: secret or public key must be provided
[1]     at C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\jsonwebtoken\verify.js:113:19
[1]     at getSecret (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\jsonwebtoken\verify.js:97:14)
[1]     at module.exports [as verify] (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\jsonwebtoken\verify.js:101:10)
[1]     at authSocketMiddleware (file:///C:/Users/MSI/Desktop/l3op/chatify/server/dist/src/middlewares/auth.js:17:29)
[1]     at Array.<anonymous> (file:///C:/Users/MSI/Desktop/l3op/chatify/server/dist/src/router/socket.js:10:39)
[1]     at run (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\socket.io\dist\namespace.js:124:19)
[1]     at Namespace.run (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\socket.io\dist\namespace.js:135:9)
[1]     at Namespace._add (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\socket.io\dist\namespace.js:211:14)
[1]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[1] GET /api/chats 304

I wonder if this issue related to Socket or i missed configuring Auth0 Management API.

Could you please guide me how to fix this issue.

Best regards.

@fraineralex
Copy link
Owner

Hello there,

I tried to run the project on my localhost and i had some issue. For the client side working just fine. i set Auth0 environment variables and i'm able to login and register. Chat are not received or sent . Like it's pending.

image

Server side i noticed some error saying:

[1] [nodemon] starting `node dist/index.js dist/index.js`
[1] Server is running in port 3000
[1] GET /api/users/metadata 304 1850.953 ms - -
[1] JsonWebTokenError: secret or public key must be provided
[1]     at C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\jsonwebtoken\verify.js:113:19
[1]     at getSecret (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\jsonwebtoken\verify.js:97:14)
[1]     at module.exports [as verify] (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\jsonwebtoken\verify.js:101:10)
[1]     at authSocketMiddleware (file:///C:/Users/MSI/Desktop/l3op/chatify/server/dist/src/middlewares/auth.js:17:29)
[1]     at Array.<anonymous> (file:///C:/Users/MSI/Desktop/l3op/chatify/server/dist/src/router/socket.js:10:39)
[1]     at run (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\socket.io\dist\namespace.js:124:19)
[1]     at Namespace.run (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\socket.io\dist\namespace.js:135:9)
[1]     at Namespace._add (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\socket.io\dist\namespace.js:211:14)
[1]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[1] GET /api/users/metadata 304 1026.164 ms - -
[1] JsonWebTokenError: secret or public key must be provided
[1]     at C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\jsonwebtoken\verify.js:113:19
[1]     at getSecret (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\jsonwebtoken\verify.js:97:14)
[1]     at module.exports [as verify] (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\jsonwebtoken\verify.js:101:10)
[1]     at authSocketMiddleware (file:///C:/Users/MSI/Desktop/l3op/chatify/server/dist/src/middlewares/auth.js:17:29)
[1]     at Array.<anonymous> (file:///C:/Users/MSI/Desktop/l3op/chatify/server/dist/src/router/socket.js:10:39)
[1]     at run (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\socket.io\dist\namespace.js:124:19)
[1]     at Namespace.run (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\socket.io\dist\namespace.js:135:9)
[1]     at Namespace._add (C:\Users\MSI\Desktop\l3op\chatify\server\node_modules\socket.io\dist\namespace.js:211:14)
[1]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[1] GET /api/chats 304

I wonder if this issue related to Socket or i missed configuring Auth0 Management API.

Could you please guide me how to fix this issue.

Best regards.

Hi there,

Thanks for the detailed description of the issue. From the error message, it looks like the problem might be related to a missing environment variable for the Auth0 Management API token.

I realized I forgot to include the AUTH0_MGMT_API_TOKEN variable in the .env.example file. I've now updated the file and pushed the changes to the repository. Please pull the latest changes, add your Auth0 Management API token to the .env file, and try running the project again locally.

Let me know if this resolves the issue or if you're still facing any problems!

Best regards,
Frainer

@l3op
Copy link
Author

l3op commented Dec 23, 2024

Hello there, I really appreciate your response.

I guess AUTH0_MGMT_API_TOKEN isn't related to the the issue at all.

I was debugging the code and i noticed that the problem is might related to this couple line code.

const publicSigningKey = process.env.AUTH0_PUBLIC_SIGNING_KEY ?? ''

const decoded = jwt.verify(token, publicSigningKey)

I'm just wondering, What's the AUTH0_PUBLIC_SIGNING_KEY should be?

Regards

@fraineralex
Copy link
Owner

Hello there, I really appreciate your response.

I guess AUTH0_MGMT_API_TOKEN isn't related to the the issue at all.

I was debugging the code and i noticed that the problem is might related to this couple line code.

const publicSigningKey = process.env.AUTH0_PUBLIC_SIGNING_KEY ?? ''

const decoded = jwt.verify(token, publicSigningKey)

I'm just wondering, What's the AUTH0_PUBLIC_SIGNING_KEY should be?

Regards

Here's a response you can post to clarify the issue and guide them:


Hello there, I really appreciate your response.

I guess AUTH0_MGMT_API_TOKEN isn't related to the the issue at all.

I was debugging the code and i noticed that the problem is might related to this couple line code.

const publicSigningKey = process.env.AUTH0_PUBLIC_SIGNING_KEY ?? ''

const decoded = jwt.verify(token, publicSigningKey)

I'm just wondering, What's the AUTH0_PUBLIC_SIGNING_KEY should be?

Regards

Hi there,

The AUTH0_PUBLIC_SIGNING_KEY is a public key used to verify the JWT signature. You can find it in the Auth0 dashboard by navigating to Applications -> Your application -> Settings -> Advanced Settings (at the bottom) -> Certificates -> Signing Certificate.

Once you have the key, set it in your .env file as AUTH0_PUBLIC_SIGNING_KEY. Be sure to include the full certificate, which should have -----BEGIN CERTIFICATE----- at the beginning and -----END CERTIFICATE----- at the end of the key.

Let me know if this resolves your issue!

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants