Closed A-Waters closed 4 years ago
i'd like to leave this in limbo a minute and merge #53 into it once it gets approved just to see if the two play nice with each other.
Okay so now in profile.js there is some extra code, to add the data in userClient.js so we can have all user data in one place. I didn't touch how data was stored in the navbar tho because I didn't want to screw anything up. seems to work fine together as far as I can tell. Also made the google id the primary key for our databsae.
Nice. You know that there is a full name variable right?
Yeah, I wasn't sure what was best there, but I didn't think we need like a whole extra variable for just two other variables combined. easy fix tho if we want it.
Feel free to merge when ready. Code working
@lenora4321
workin on it
Looks clean, login works, good job!
This covers a bit of the issue since we have 4 that are very similar in their end goal
33 #31 #46 #47
As of making this pull request, the google login isn't implemented, so for rn the google ID I'm using is just a random number. Also, I'm hoping google can help Handel security.
time to break this down
backend
first thing I did was remove articles Okay in basically there is now another model known as 'user', which holds the following properties:
there are now 4 more endpoints with corresponding methods each having thier own view:
note I was running into a cors issue here so I have a workaround but it's not technically 'safe', but for rn, it works.
frontend
new file ----> userClient.js how this works is very similar to the Spotify API.
how to use :
(example can be found in list.js componentDidMount())
its pretty self explanatory but the idea is you take the id number we get from google, and we put it into the login function. Here a user will be created if there is already not a preexisting user. after doing this you can make calls to the user client for setting and getting data as listen in the userClient.js
you will have to have the backend running for this to work
Lmk if you have questions, confusion, or problems.