laravel vuejs Laravel Passport Scope Based Auth VueRouter Vuex and Laravel 6 SPALogout User

okay everything looks good here but yeah before going further I just don't like this hash to be here and if I remove this from here something like this then it will give me that's 404 so what we have to do every come here and inside our resources and then J's and then Crowder touches first of all here we need to define a mood and let's say history I'll save this and reload it's again saying the same okay and here one more thing inside route and then we've got PHP here we have he was this near any can be anything like this don't just reload this and ifs work fine and for we don't have dead hash anymore here okay so I'll put this now we have to work on logout so when's I'm gonna click on this then the user should be logged out so let's come back here and let's find this this is inside components and in header and if we look here there's social on oh yeah this is here well but I just want to use a button here and we'll give it a saved loss of this and same text let's just remove this and he so when someone click on this then we have to call a method love it and we adhere so let's let her to send them out back logout but we don't have this here okay but we need to define this inside out also with foster support first upon does not adhere know not only to be inside out service and here here we need to send HTTP request up get and if we looked or FBI then here we need 12 we pick some out out and then you need to have a lot of okay this is fine so let's come back here and import it okay don't clock out we have to push the user get the login edge okay this is fine door router touches so here we need one more thing let's copy this middle way from here the best are here now if we user is not logged in then we have to allow him to access login path login route but if it is already logged in then we have to move the user to the home page and do not display the login and if we save it like this currently if they visit your login it will redirect us to the home page because we are already logged in so this is fine now let's don't leave this request okay this is fine and this is also fine but when someone Margaux then we have to remove their this item from the local storage also a local story start with no - and then we have to go get this one tested here and then this okay so remove this item from the local storage this is fine now there's just this reload every would on inspect element and inside console we have this has launched a droid okay you know here you we don't need to have this desk here because it has a children and the children already has our name so they're straight old and this one and we'll know more here okay so now I'd be click on network tab and let's click on logout okay be riche to down logout but it says unauthenticated it is because we have to send our token to access this route if you look here here we need we have a middle there of a PIR that yes we have the same our token to when ovl accessing this route okay but we already logged out if he looked or resources or application we don't have that token here and it says I'm not right so let's send the token then now if we click oh we cannot access because we don't have the token anymore so let's come back here and and so you're also this okay inside your HTTP service here we need to have our headers and authorization and inside authorization we need to have their here then space and then I'll get access for pet okay and we have to define this method but before that let's import or also this year and yeah outside the same this is fine now let's define this gate access token and so I know also this so here export and here first we need to get a token so local storage dot get item and this item we need to get okay and if we don't have the token then you can return long otherwise let's okay left store that token but we have to use the Chi JWT to decode the token Oh Deathstalker okay so it will decode the token and to the law will form then from this token data we can get the user and then excess underscore token it will return the token okay and attached to this thing so we need this also to be here so let's copy that stuff here this is fine now let's just this once we need to login to my grave gmail.com and then five one two three and now if we click here on blackout we have a we are logged out successfully and if we check here log of successfully and we got this message from or ABA so recycle our controller so let's check to TB controllers and and our controller and then the logout method says like yes this is working just fine okay so let's do further things in the next tutorial

Loading