ansonbenny / Music-Streamer

The website for listening to music and making your favorite music collection. This project is made in the MERN stack
https://musicon-nvce.onrender.com
MIT License
7 stars 2 forks source link

Error : JsonWebTokenError #1

Closed arun-nextbrain closed 11 months ago

arun-nextbrain commented 12 months ago

Hi @ansonbenny I'm new to this project basically i'm a python developer I wanted to learn react and node Error : JsonWebTokenError I don't know why this error is coming please help me

ansonbenny commented 12 months ago

share the full error message to identify problem. you must fill .env file

arun-nextbrain commented 12 months ago

share the full error message to identify problem. you must fill .env file

@ansonbenny

.env PORT = 5000

MONGO_URL = "mongodb://localhost:27017"

SITE_URL = ""

JWT_SECRET = "xahui8766snjkls"

SPOTIFY_ID = "33d0b3ec86af4210a781d00e66bf232akil"

SPOTIFY_SECRET = "22626f800f4f4a3f94ff4d56d364234aju"

MAIL_EMAIL = "designartis@gmail.com"

MAIL_SECRET = "sgbzgtqhmgmbxxxxxx"

VITE_GOOGLE_CLIENT = "289153080841-7v6rvdgkfa8r66ju27dar2utd5deh09a.apps.googleusercontent.com"

Client-side console log: Screenshot from 2023-09-22 14-55-41

Server-side console log: Screenshot from 2023-09-22 14-55-38

let know what i'm doing wrong

ansonbenny commented 12 months ago

that's not code issues, when you are not logged (or when jwt token expired) that will show

ansonbenny commented 12 months ago

you must fill SITE_URL = [when local run http://localhost:5173/ or your site domain for work cors & mail links]

arun-nextbrain commented 12 months ago

that's not code issues, when you are not logged (or when jwt token expired) that will show

Where I can get the JWT token?

ansonbenny commented 12 months ago

that's not code issues, when you are not logged (or when jwt token expired) that will show

Where I can get the JWT token?

that will auto generate when user login and save token into cookie, to work cookie you must fill SITE_URL in .env

ansonbenny commented 12 months ago

VITE_GOOGLE_CLIENT in .env.local in react folder other env property and values in .env in server folder

arun-nextbrain commented 12 months ago

that's not code issues, when you are not logged (or when jwt token expired) that will show

Where I can get the JWT token?

that will auto generate when user login and save token into cookie, to work cookie you must fill SITE_URL in .env

Now I'm fill the SITE_URL and checking but the same error will shown

can you please guide me to setup the project on my local system

Also when I click the signup, login button and play button the screen was blank nothing will happen why?

ansonbenny commented 12 months ago

that's not code issues, when you are not logged (or when jwt token expired) that will show

Where I can get the JWT token?

that will auto generate when user login and save token into cookie, to work cookie you must fill SITE_URL in .env

Now I'm fill the SITE_URL and checking but the same error will shown

can you please guide me to setup the project on my local system

Also when I click the signup, login button and play button the screen was blank nothing will happen why?

share screenshot

ansonbenny commented 12 months ago

.env.txt

this env file for server folder

ansonbenny commented 12 months ago

.env.local.txt

this one for client folder

arun-nextbrain commented 12 months ago

@ansonbenny Thanks bro now it's working thanks a lot for your help