switcher, have bugs
This commit is contained in:
21
client/src/tui/functions/common/login.rs
Normal file
21
client/src/tui/functions/common/login.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
// src/tui/functions/common/login.rs
|
||||
|
||||
use crate::state::pages::auth::AuthState;
|
||||
use crate::services::grpc_client::GrpcClient;
|
||||
|
||||
/// Shared logic for login operations
|
||||
pub async fn save(
|
||||
auth_state: &mut AuthState,
|
||||
grpc_client: &mut GrpcClient,
|
||||
) -> Result<String, Box<dyn std::error::Error>> {
|
||||
// Implement your login-specific save logic here
|
||||
Ok("Login credentials saved".to_string())
|
||||
}
|
||||
|
||||
/// Shared logic for login cancellation
|
||||
pub async fn cancel(
|
||||
auth_state: &mut AuthState,
|
||||
) -> String {
|
||||
auth_state.clear_fields();
|
||||
"Login cancelled".to_string()
|
||||
}
|
||||
Reference in New Issue
Block a user