migrate to nuxt and groundwork

This commit is contained in:
DecDuck
2024-10-08 00:39:42 +11:00
parent c46c54b2a5
commit c9577444cd
83 changed files with 5566 additions and 388 deletions

14
src-tauri/src/auth.rs Normal file
View File

@ -0,0 +1,14 @@
use tauri::Error;
use crate::{data::DatabaseInterface, AppAuthenticationStatus, User};
pub fn setup(db: DatabaseInterface) -> Result<(AppAuthenticationStatus, Option<User>), Error> {
let data = db.get_data(true).unwrap();
// If we have certs, exit for now
if data.certs.is_some() {
// TODO: check if it's still valid, and fetch user information
return Ok((AppAuthenticationStatus::SignedInNeedsReauth, None));
}
return Ok((AppAuthenticationStatus::SignedOut, None));
}