feat(auth): refactoring and error message

This commit is contained in:
DecDuck
2024-11-19 15:05:28 +11:00
parent 2d4a7e8f9c
commit 469a2d69eb
4 changed files with 58 additions and 37 deletions

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;
}