From a124f46861d549ddc13485536962e34d80de939a Mon Sep 17 00:00:00 2001 From: Osmium Sorcerer Date: Sun, 22 Mar 2026 18:55:26 +0000 Subject: Add authentication dialog Introduce start_auth_flow, a function invoked by typing `/auth username` in OOC. It sends an public-key authentication request to the server, starting the entire flow. The flow invoves two dialogs: to select the key, and to enter the passphrase to unlock the key. For convenience, each successful unlock also remembers the key for that username on the server, storing this in `saved_auth.json` (I chose JSON because I wanted it to stay human-editable; INI would be better, but it suffers from bad platform quirks in Qt). --- src/courtroom.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/courtroom.cpp') diff --git a/src/courtroom.cpp b/src/courtroom.cpp index 1eaa747..a2dca24 100644 --- a/src/courtroom.cpp +++ b/src/courtroom.cpp @@ -5118,6 +5118,19 @@ void Courtroom::on_ooc_return_pressed() ui_ooc_chat_message->clear(); return; } + // Only works on CSDWASASH. + else if (ooc_message.startsWith("/auth")) + { + QStringList command = ooc_message.split(" ", Qt::SkipEmptyParts); + if (command.size() != 2) + { + append_server_chatmessage("CLIENT", "Usage: /auth ", "1"); + return; + } + start_auth_flow(ao_app, command[1]); + ui_ooc_chat_message->clear(); + return; + } QStringList packet_contents; packet_contents.append(ui_ooc_chat_name->text()); -- cgit