CSI-280 / MusicGames

0 stars 0 forks source link

issues #33 #31 #46 #47 #52

Closed A-Waters closed 4 years ago

A-Waters commented 4 years ago

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.

jbuzzell commented 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.

A-Waters commented 4 years ago

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.

JakeCapra commented 4 years ago

Nice. You know that there is a full name variable right?

A-Waters commented 4 years ago

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.

A-Waters commented 4 years ago

Feel free to merge when ready. Code working

A-Waters commented 4 years ago

@lenora4321

lenora4321 commented 4 years ago

workin on it

lenora4321 commented 4 years ago

Looks clean, login works, good job!