store base credentials as well as session credentials

This commit is contained in:
jfmonty2 committed 2023-05-01 23:03:34 -07:00
1 parent 760987f09b
commit 161148d1f6
4 files changed
+50 -48

No files matched your search

+4 -4
View File
@@ -4,7 +4,7 @@ use tauri::State;
use crate::errors::*;
use crate::config::AppConfig;
use crate::clientinfo::Client;
use crate::state::{AppState, Session, Credentials};
use crate::state::{AppState, Session, BaseCredentials};
#[derive(Clone, Debug, Serialize, Deserialize)]
@@ -37,7 +37,7 @@ pub fn respond(response: RequestResponse, app_state: State<'_, AppState>) -> Res
#[tauri::command]
pub async fn unlock(passphrase: String, app_state: State<'_, AppState>) -> Result<(), UnlockError> {
app_state.decrypt(&passphrase).await
app_state.unlock(&passphrase).await
}
@@ -46,7 +46,7 @@ pub fn get_session_status(app_state: State<'_, AppState>) -> String {
let session = app_state.session.read().unwrap();
match *session {
Session::Locked(_) => "locked".into(),
Session::Unlocked(_) => "unlocked".into(),
Session::Unlocked{..} => "unlocked".into(),
Session::Empty => "empty".into()
}
}
@@ -54,7 +54,7 @@ pub fn get_session_status(app_state: State<'_, AppState>) -> String {
#[tauri::command]
pub async fn save_credentials(
credentials: Credentials,
credentials: BaseCredentials,
passphrase: String,
app_state: State<'_, AppState>
) -> Result<(), UnlockError> {