imperialwool commited on
Commit
73c012d
1 Parent(s): a4823ca

fixed finally i think

Browse files
Files changed (2) hide show
  1. routes/helpers.py +1 -1
  2. routes/siteRoutes/sigGen.py +2 -4
routes/helpers.py CHANGED
@@ -63,7 +63,7 @@ def thisIsHook(d):
63
  def getFromRequest(request, thing: str):
64
  try:
65
  if request.method == 'POST': reqthing = request.form[thing]
66
- else: reqthing = thing.args[thing]
67
  return reqthing
68
  except: return None
69
 
 
63
  def getFromRequest(request, thing: str):
64
  try:
65
  if request.method == 'POST': reqthing = request.form[thing]
66
+ else: reqthing = request.args[thing]
67
  return reqthing
68
  except: return None
69
 
routes/siteRoutes/sigGen.py CHANGED
@@ -6,10 +6,8 @@ from .. import helpers
6
  def signatureGen(request):
7
  endtime = round(time.time())+3600
8
 
9
- try:
10
- if request.method == 'POST': uK = request.form["key"]
11
- else: uK = thing.args["key"]
12
- except: return {"status": "error", "details": {"error_code": -1, "error_details": "No key to generate signature"}}
13
 
14
  userKey = hashlib.md5(uK.encode()).hexdigest()
15
  text = f"--START SIGNATURE-- {userKey}{endtime} --END SIGNATURE--"
 
6
  def signatureGen(request):
7
  endtime = round(time.time())+3600
8
 
9
+ uK = helpers.getFromRequest(request, "key")
10
+ if uK == None: return {"status": "error", "details": {"error_code": -1, "error_details": "No key to generate signature"}}
 
 
11
 
12
  userKey = hashlib.md5(uK.encode()).hexdigest()
13
  text = f"--START SIGNATURE-- {userKey}{endtime} --END SIGNATURE--"