Open ituageorge opened 3 years ago
I cant. see the config.json
file
what value type is expected for secret in jwt (C:\Users\GEORGE\Desktop\exam-timed-backend-app_helpers\jwt.js:13:12)
are you there?
String or JSON?
string
put the value in the config file directly into the secret
param of the function and see if it works
goodafternoon The secret is working now
On Sun, Jan 17, 2021 at 2:53 PM Adebola Victor notifications@github.com wrote:
put the value in the config file directly into the secret param of the function and see if it works
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ituageorge/exam-timed-backend-app/issues/1#issuecomment-761816138, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMB4HO3RYARHZUCTICHODXDS2LTXNANCNFSM4WFFNOKA .
How did you resolve it?
I omitted to put require('rootpath')() at the beginning of the file to require or import the file name directly without having to trace the path Or simply require the file by using the path eg const jwt = require( '../_helpers/jwt');
On Mon, Jan 18, 2021 at 2:36 PM itua osagie ituaosagie100@gmail.com wrote:
goodafternoon The secret is working now
On Sun, Jan 17, 2021 at 2:53 PM Adebola Victor notifications@github.com wrote:
put the value in the config file directly into the secret param of the function and see if it works
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ituageorge/exam-timed-backend-app/issues/1#issuecomment-761816138, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMB4HO3RYARHZUCTICHODXDS2LTXNANCNFSM4WFFNOKA .
This is showing at the console:
Server listening on port 80
(node:11132) UnhandledPromiseRejectionWarning:
MongooseServerSelectionError: Could not connect to any servers in your
MongoDB Atlas cluster. One common reason is that you're trying to access
the database from an IP that isn't whitelisted. Make sure your current IP
address is on your Atlas cluster's
IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/
at NativeConnection.Connection.openUri
(C:\Users\GEORGE\Desktop\exam-timed-backend-app\node_modules\mongoose\lib\connection.js:832:32)
at
C:\Users\GEORGE\Desktop\exam-timed-backend-app\node_modules\mongoose\lib\index.js:345:10
at
C:\Users\GEORGE\Desktop\exam-timed-backend-app\node_modules\mongoose\lib\helpers\promiseOrCallback.js:31:5
at new Promise (
On Mon, Jan 18, 2021 at 3:18 PM itua osagie ituaosagie100@gmail.com wrote:
I omitted to put require('rootpath')() at the beginning of the file to require or import the file name directly without having to trace the path Or simply require the file by using the path eg const jwt = require( '../_helpers/jwt');
On Mon, Jan 18, 2021 at 2:36 PM itua osagie ituaosagie100@gmail.com wrote:
goodafternoon The secret is working now
On Sun, Jan 17, 2021 at 2:53 PM Adebola Victor notifications@github.com wrote:
put the value in the config file directly into the secret param of the function and see if it works
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ituageorge/exam-timed-backend-app/issues/1#issuecomment-761816138, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMB4HO3RYARHZUCTICHODXDS2LTXNANCNFSM4WFFNOKA .
Open a new issue ticket for it
Ok. This particular issue has been resolved
It's important to share how it was resolved for reference purpose and to help others when they come across the issue
Error: secret should be set at module.exports (C:\Users\GEORGE\Desktop\exam-timed-backend-app\node_modules\express-jwt\lib\index.js:20:42) at jwt (C:\Users\GEORGE\Desktop\exam-timed-backend-app_helpers\jwt.js:13:12) at Object. (C:\Users\GEORGE\Desktop\exam-timed-backend-app\server.js:15:9)
at Module._compile (internal/modules/cjs/loader.js:955:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
at Module.load (internal/modules/cjs/loader.js:811:32)
at Function.Module._load (internal/modules/cjs/loader.js:723:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
at internal/main/run_main_module.js:17:11
[nodemon] app crashed - waiting for file changes before starting...