Jcloghesy / finalProject

1 stars 0 forks source link

Saturday's Meeting Tasks (Manpreet) - Front End Coding #9

Open Jcloghesy opened 1 year ago

Jcloghesy commented 1 year ago

Alvin's Notes (from Saturday's meeting) - Manpreet

1. AUTHO LOGIN

2. CONNECT FRONT & BACK END (with Login)

- Overall process involves: making a use effect, to call your backend

 (i.e., localhost:8080/api/login)
 i. Front-end you send the user object to the back end
 ii. Back-end receives that object and checks the database for the "sub_id"
     a. matching sub_id -> return user that matches return to front-end
     b. no matching -> insert user to database, then return to front-end

- Specific Tasks

- Example Code

  user.sub_id === "google:oath-sj232ah18sh19sn3"
  SELECT * FROM USERS WHERE sub_id =  "google:oath-sj232ah18sh19sn3"
   this is going to return NO MATCH
   {
    id: 1
    email: aladf.com
    first_name: John
    last_name: nathan
    sub_id: = "google:oath-sj232ah18sh19sn3"
    }