Fixed various issues
This commit is contained in:
parent
8f79a09780
commit
c3b1d4e4e3
14
main
14
main
|
@ -251,12 +251,12 @@ async def apiopeniduserinfo():
|
||||||
@app.route("/api/auth")
|
@app.route("/api/auth")
|
||||||
async def apiauthenticate():
|
async def apiauthenticate():
|
||||||
if request.method == "GET":
|
if request.method == "GET":
|
||||||
secretKey = request.cookies.get["key"]
|
secretKey = request.cookies.get("key")
|
||||||
appId = request.args.get["client_id"]
|
appId = request.args.get("client_id")
|
||||||
code = request.args.get["code_challenge"]
|
code = request.args.get("code_challenge")
|
||||||
codemethod = request.args.get["code_challenge_method"]
|
codemethod = request.args.get("code_challenge_method")
|
||||||
redirect = request.args.get["redirect_uri"]
|
redirect_uri = request.args.get("redirect_uri")
|
||||||
state = request.args.get["state"]
|
state = request.args.get("state")
|
||||||
|
|
||||||
userCookie = get_session(secretKey)
|
userCookie = get_session(secretKey)
|
||||||
user = get_user(userCookie["id"])
|
user = get_user(userCookie["id"])
|
||||||
|
@ -300,7 +300,7 @@ async def apiauthenticate():
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
if secretkey:
|
if secretkey:
|
||||||
return redirect(redirect_uri + "?code=" + secretkey + "&state=" + state), 200
|
return redirect(redirect_uri + "?code=" + secretkey + "&state=" + state), 302
|
||||||
else:
|
else:
|
||||||
return {}, 400
|
return {}, 400
|
||||||
|
|
||||||
|
|
Reference in New Issue