mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-15 09:11:28 +10:00
migrate to nuxt and groundwork
This commit is contained in:
14
src-tauri/src/auth.rs
Normal file
14
src-tauri/src/auth.rs
Normal 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));
|
||||
}
|
||||
Reference in New Issue
Block a user