#Code: 'TokenInvalid'
46 messages · Page 1 of 1 (latest)
oops forgot to press node.js category
do you load the env file into the process environment?
How do i do that. im kinda new to coding in general
well, you use dotenv, so yes, you do
what does your ..env file look like?
console.log(process.env.token) logs the token?
(above the login call)
like this?
aye
when i do npm run test still the same error
does it print the token?
nope
looks like it tried
then it didn't load the file
oh.
How do i do that...
well, require("dotenv").config() should do that, provided you placed the .env file in the project root folder
i placed it into functions\handlers
lemme take it in src folder
nvm the functions\handlers are in the src folder
the .env file is the relevant bit, should be in the project root, where your package json and stuff is
.envfile [...] where your package json [...] is
there
'
try to log process.env instead
also move the dotenv config stuff to the top
right after the other requires
there we go
thank you for the help!
that was the secret bit, btw
yeah thats why i didnt show the whole token...
doesn't matter, the first bit is the user id of the owner
oh... ok
now i know that
ah ok i understood half of that.
that's more than enough 
Lol
everything up to the first dot isn't really a secret, everything after that is - is what it boils down to