Vue.js front end app, part 3 | vue js axios token
Inthispartwe’llallowtheusertologintoourfrontendapp,usingtheauthmechanism[1]we’vebuiltonthebackendearlier.Alotoftopicsinthisone,sojumprightin!Wedidalotoftalkinginthepreviouspost,abunchofdrawingsquares,andalmostzerocoding.Andwithgoodreason,too.ButI’mraringtocodealready,andIguesssoareyou!Noworries:today’spostisallcode,allthetime.Whenwe’velastpartedwayswithourapp,itlookedlikethis:Well-that’snobookstore,isit.Weneedtodosomethingaboutit,andaswe’vediscussedlasttimethefirstthingweneedisaloginscreen.U...
In this part we’ll allow the user to log in to our frontend app, using the auth mechanism[1] we’ve built on the back end earlier. A lot of topics in this one, so jump right in!
We did a lot of talking in the previous post, a bunch of drawing squares, and almost zero coding. And with good reason, too. But I’m raring to code already, and I guess so are you! No worries: today’s post is all code, all the time.
When we’ve last parted ways with our app, it looked like this:
Well - that’s no bookstore, is it. We need to do something about it, and as we’ve discussed last time the first thing we need is a login screen.
Usually a log-in screen might be located at /login, /sign-in or other such URL. But our app cannot be used at all without logging in - that’s how we designed the API - so we’ll be justified in just putting the log in screen on / in this case.
So what needs to happen when the user arrives at the app is:
If they are no...