feat(auth): refactoring and error message

This commit is contained in:
DecDuck
2024-11-19 15:05:28 +11:00
parent c18b964b3e
commit ed87b6896b
4 changed files with 58 additions and 37 deletions
+3 -2
View File
@@ -141,8 +141,9 @@ pub fn recieve_handshake(app: AppHandle, path: String) {
app.emit("auth/processing", ()).unwrap();
let handshake_result = recieve_handshake_logic(&app, path);
if handshake_result.is_err() {
app.emit("auth/failed", ()).unwrap();
if let Err(e) = handshake_result {
warn!("error with authentication: {}", e);
app.emit("auth/failed", e.to_string()).unwrap();
return;
}