1
0
Fork 0
firefox/testing/web-platform/tests/fedcm/support/disconnect.py
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

14 lines
587 B
Python

import importlib
error_checker = importlib.import_module("fedcm.support.request-params-check")
def main(request, response):
response.headers.set(b"Content-Type", b"application/json")
response.headers.set(b"Access-Control-Allow-Origin", request.headers.get(b"origin"))
response.headers.set(b"Access-Control-Allow-Credentials", b"true")
request_error = error_checker.revokeCheck(request)
if request_error:
return request_error
# Pass the account_hint as the accountId.
account_hint = request.POST.get(b"account_hint")
return f"{{\"account_id\": \"{account_hint}\"}}"