Skip to content

Commit

Permalink
feat: changed qrcode handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Gartic99 committed Dec 18, 2023
1 parent f82d4d4 commit ea930c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
7 changes: 2 additions & 5 deletions pyeudiw/satosa/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,11 @@ def pre_request_endpoint(self, context: Context, internal_request, **kwargs) ->

# Cross Device flow
res_url = f'{self.client_id}?{url_params}'
encoded_res_url = base64.urlsafe_b64encode(res_url.encode())

# response = base64.b64encode(res_url.encode())
qrcode = QRCode(encoded_res_url, **self.config['qrcode'])

result = self.template.qrcode_page.render(
{
'qrcode_base64': qrcode.to_base64(),
"qrcode_color" : self.config["qrcode"]["color"],
"qrcode_text": res_url,
"state": state,
"status_endpoint": self.absolute_status_url
}
Expand Down
5 changes: 0 additions & 5 deletions pyeudiw/tests/satosa/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,6 @@ def test_pre_request_endpoint(self, context):
assert state_div
assert state_div["value"]

svg = BeautifulSoup(decoded, features="xml")
assert svg
assert svg.find("svg")
assert svg.find_all("path")

def test_pre_request_endpoint_mobile(self, context):
self.backend.register_endpoints()
internal_data = InternalData()
Expand Down

0 comments on commit ea930c6

Please sign in to comment.