Skip to content
Snippets Groups Projects
Commit a28c5e26 authored by Andreas Domanowski's avatar Andreas Domanowski
Browse files

Add parameter to session cookie prompt

parent 8dbbed1e
Branches
No related tags found
1 merge request!1Hedgedoc import
...@@ -55,4 +55,4 @@ def main(instance_url, session_id, export_to): ...@@ -55,4 +55,4 @@ def main(instance_url, session_id, export_to):
if __name__ == "__main__": if __name__ == "__main__":
main("https://md.inf.tu-dresden.de", get_sessionid(), "codimd-documents") main("https://md.inf.tu-dresden.de", get_sessionid("connect.sid"), "codimd-documents")
...@@ -7,9 +7,9 @@ else: ...@@ -7,9 +7,9 @@ else:
getpass = input getpass = input
def get_sessionid(): def get_sessionid(cookie_key):
"""Ask the user for the session id, if it's not configured as an envvar.""" """Ask the user for the session id, if it's not configured as an envvar."""
sid = getpass("Please provide your CodiMD session id (connect.sid cookie): ") sid = getpass(f"Please provide your CodiMD session id ({cookie_key} cookie): ")
if sid.startswith("s%3A"): if sid.startswith("s%3A"):
return sid return sid
raise SystemExit(f"error: the supplied session id seems to be malformed") raise SystemExit(f"error: the supplied session id seems to be malformed")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment