hiteshchoudhary / chai-backend

A video series on chai aur code youtube channel
5.24k stars 784 forks source link

Issue Occur in LogOut #83

Open Talhaayubkhan opened 9 months ago

Talhaayubkhan commented 9 months ago

if i send req using postman (generally issue occur in logout route)!! jwt must be a string Error: Invalid AccessToken at file:///C:/Users/win11/OneDrive/Desktop/Backend/src/middleware/auth.middleware.js:30:17

arush6477 commented 9 months ago

Hey @Talhaayub1 i went through your repo and found out that you the issue The issue is in your loginUser function in the User controllers in response you are not sending the "tokens in cookies" it should be - .cookie("accessToken" , accessToken , options) .cookie("refershToken" , refreshToken , options)

Screenshot 2024-01-25 130439
Talhaayubkhan commented 9 months ago

yes i notice it, but finally i solve the issue after 2 days!!! Thanks Mannnnn 🙌

vrk0ranit commented 8 months ago

I'm getting error in logout user when I send request through Postman it's through an error of jet malformed

abhi-20 commented 8 months ago

getting same error

logout_videotube

vrk0ranit commented 8 months ago

Hey buddy thanks for addressing my issue.I solved it many days ago this all happened just because of my typo error

On Wed, 6 Mar, 2024, 7:48 pm abhi-20, @.***> wrote:

getting same error

logout_videotube.png (view on web) https://github.com/hiteshchoudhary/chai-backend/assets/58565895/35ef9da6-fee7-4265-bad9-02a4bef856d7

— Reply to this email directly, view it on GitHub https://github.com/hiteshchoudhary/chai-backend/issues/83#issuecomment-1980973479, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4HTTC2NJ72OD363UTAOAL3YW4QSVAVCNFSM6AAAAABCHGHU36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBQHE3TGNBXHE . You are receiving this because you commented.Message ID: @.***>

Mayank06711 commented 7 months ago

Error: jwt must be a string I`m getting this error on logout request I don't know how to solve this issue sourcelink checked my code number of times

AdarshTheki commented 7 months ago

const options = { httpOnly:true } // remove secure: true to resolve this problem to get accessToken to undefine