Use code instead of authorization_response

This commit is contained in:
Luka Radenovic 2022-01-20 07:40:11 +01:00
parent 5290bedc77
commit 34796a7d82
2 changed files with 8 additions and 4 deletions

View file

@ -24,14 +24,14 @@ class HydraOauth:
raise HydraError(str(err), 500)
@staticmethod
def get_token(state):
def get_token(state, code):
try:
hydra = OAuth2Session(HYDRA_CLIENT_ID, state=state)
token = hydra.fetch_token(
TOKEN_URL,
code=code,
state=state,
client_secret=HYDRA_CLIENT_SECRET,
authorization_response="https://dashboard.init.stackspin.net"
+ request.path,
)
session["hydra_token"] = token