Nattyboi commited on
Commit
f3b3e61
·
1 Parent(s): aee3aac

changed up something for jwt

Browse files
Files changed (2) hide show
  1. app.py +2 -3
  2. utils.py +1 -1
app.py CHANGED
@@ -110,8 +110,7 @@ def get_course_func(query):
110
  content_structure["courseSnippet"]= snippet
111
  content_structure["scrapedCourseDetails"]= scrapeCourse(url=link)
112
  content.append(content_structure)
113
-
114
-
115
  return content
116
 
117
 
@@ -298,7 +297,7 @@ def login(user:UserBody):
298
 
299
  @app.post("/auth/signup",tags=["Authentication"])
300
  def signUp(user:UserBody):
301
- user ={"email":user.email,"password":user.password}
302
  user_id= create_user(db_uri=MONGO_URI,db_name="crayonics",collection_name="users",document=user)
303
  if user_id != False:
304
  refreshToken=create_refreshToken(db_uri=MONGO_URI,user_id=user_id)
 
110
  content_structure["courseSnippet"]= snippet
111
  content_structure["scrapedCourseDetails"]= scrapeCourse(url=link)
112
  content.append(content_structure)
113
+
 
114
  return content
115
 
116
 
 
297
 
298
  @app.post("/auth/signup",tags=["Authentication"])
299
  def signUp(user:UserBody):
300
+ user ={"email":user.email,"password":user.password,"first_name":user.firstName,"last_name":user.lastName}
301
  user_id= create_user(db_uri=MONGO_URI,db_name="crayonics",collection_name="users",document=user)
302
  if user_id != False:
303
  refreshToken=create_refreshToken(db_uri=MONGO_URI,user_id=user_id)
utils.py CHANGED
@@ -144,7 +144,7 @@ def create_user(db_uri: str, db_name: str, collection_name: str, document: dict)
144
  return str(result.inserted_id)
145
  else:
146
  client.close()
147
- return "User Already Exists"
148
 
149
  # Close the connection
150
 
 
144
  return str(result.inserted_id)
145
  else:
146
  client.close()
147
+ return False
148
 
149
  # Close the connection
150