CaesarCloudSync commited on
Commit
cb8fcca
·
1 Parent(s): 83aac44

Make Signup auth json Model mor general

Browse files
Files changed (1) hide show
  1. main.py +4 -4
main.py CHANGED
@@ -961,12 +961,12 @@ async def physicsaqa(data : JSONStructure = None, authorization: str = Header(No
961
  @app.post('/signupapi') # POST
962
  async def signup(data: JSONStructure = None):
963
  try:
 
964
  data = dict(data)
965
  print(data)
966
- data["id"] = ObjectId()
967
- data["access"] = True
968
- user = Users(**data)
969
- signupdata = user.to_bson()
970
 
971
  print(signupdata["email"])
972
  email_exists = importcsv.db.users.find_one({"email": signupdata["email"]})
 
961
  @app.post('/signupapi') # POST
962
  async def signup(data: JSONStructure = None):
963
  try:
964
+ signupdata = {}
965
  data = dict(data)
966
  print(data)
967
+ hashed = hashlib.sha256(data["password"].encode('utf-8')).hexdigest()
968
+ signupdata["email"] = data["email"]
969
+ signupdata["password"] = hashed
 
970
 
971
  print(signupdata["email"])
972
  email_exists = importcsv.db.users.find_one({"email": signupdata["email"]})