chai-backend icon indicating copy to clipboard operation
chai-backend copied to clipboard

Issue Occur in LogOut

Open Talhaayubkhan opened this issue 1 year ago • 7 comments

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

Talhaayubkhan avatar Jan 23 '24 15:01 Talhaayubkhan

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

arush6477 avatar Jan 25 '24 07:01 arush6477

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

Talhaayubkhan avatar Jan 25 '24 19:01 Talhaayubkhan

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

vrk0ranit avatar Feb 13 '24 05:02 vrk0ranit

getting same error

logout_videotube

abhi-20 avatar Mar 06 '24 14:03 abhi-20

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: @.***>

vrk0ranit avatar Mar 06 '24 14:03 vrk0ranit

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

Mayank06711 avatar Mar 15 '24 21:03 Mayank06711

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

AdarshTheki avatar Apr 09 '24 04:04 AdarshTheki