Skip to content

Commit

Permalink
Specify to save the file as json
Browse files Browse the repository at this point in the history
This fixes a mistake whereby the file was saved as a bytestream, rather than JSON
  • Loading branch information
jonodrew committed Jun 21, 2024
1 parent 8cb0e58 commit 756ac3c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import traceback
import re
import os
import uuid

import jwt_signing
import sso_oidc
import werkzeug
Expand All @@ -23,11 +25,9 @@
)
from apig_wsgi import make_lambda_handler
from notifications_python_client.notifications import NotificationsAPIClient
from urllib.parse import parse_qs, unquote
from functools import wraps

from jinja_helper import renderTemplate
from sso_data_access import read_file, write_file
from sso_utils import random_string, env_var, sanitise_string, jprint, set_redacted
from sso_email_check import valid_email
from email_helper import email_parts
Expand Down Expand Up @@ -1411,9 +1411,10 @@ def new_client():
client_secret_dict = generate_client_auth_pair()
client_id = client_secret_dict.get("client_id")
client_secret = client_secret_dict.get("client_secret")
request_dict = request.form.to_dict()
sso_oidc.save_client(
filename=uuid.uuid4().hex,
client={"secret": client_secret, **request.form.to_dict()},
filename=f"{request_dict['app_url']}_{uuid.uuid4().hex}.json",
client={"secret": client_secret, **request_dict},
client_id=client_id
)
return redirect(f"/view?client_id={client_id}")
Expand Down

0 comments on commit 756ac3c

Please sign in to comment.