You've already forked AstralRinth
forked from didirus/AstralRinth
Compiler improvements (#145)
* Initial bug fixes * fix compile error on non-mac * Fix even more bugs * Fix more * fix more * fix build * fix build * working basic * removed zip * working functions * merge fixes * fixed loadintg bar bug * changed to one layer deep * forge version numbers * improvements + refactoring * renamed things to fit plugin * fixed bugs * removed println * overrides dont include mrpack * merge * fixes * fixes * fixed deletion * merge errors * force sync before export * removed testing * missed line * removed console log * mac error reverted * incoreclty named helper * added to new register method * review changes * minor changes * moved create pack * renamed function --------- Co-authored-by: Jai A <jaiagr+gpg@pm.me>
This commit is contained in:
@@ -1,6 +1,22 @@
|
||||
use crate::api::Result;
|
||||
use tauri::plugin::TauriPlugin;
|
||||
use theseus::prelude::*;
|
||||
|
||||
pub fn init<R: tauri::Runtime>() -> TauriPlugin<R> {
|
||||
tauri::plugin::Builder::new("auth")
|
||||
.invoke_handler(tauri::generate_handler![
|
||||
auth_authenticate_begin_flow,
|
||||
auth_authenticate_await_completion,
|
||||
auth_cancel_flow,
|
||||
auth_refresh,
|
||||
auth_remove_user,
|
||||
auth_has_user,
|
||||
auth_users,
|
||||
auth_get_user,
|
||||
])
|
||||
.build()
|
||||
}
|
||||
|
||||
/// Authenticate a user with Hydra - part 1
|
||||
/// This begins the authentication flow quasi-synchronously, returning a URL to visit (that the user will sign in at)
|
||||
#[tauri::command]
|
||||
@@ -22,7 +38,7 @@ pub async fn auth_cancel_flow() -> Result<()> {
|
||||
}
|
||||
|
||||
/// Refresh some credentials using Hydra, if needed
|
||||
// invoke('auth_refresh',user)
|
||||
// invoke('plugin:auth|auth_refresh',user)
|
||||
#[tauri::command]
|
||||
pub async fn auth_refresh(user: uuid::Uuid) -> Result<Credentials> {
|
||||
Ok(auth::refresh(user).await?)
|
||||
@@ -34,14 +50,14 @@ pub async fn auth_remove_user(user: uuid::Uuid) -> Result<()> {
|
||||
}
|
||||
|
||||
/// Check if a user exists in Theseus
|
||||
// invoke('auth_has_user',user)
|
||||
// invoke('plugin:auth|auth_has_user',user)
|
||||
#[tauri::command]
|
||||
pub async fn auth_has_user(user: uuid::Uuid) -> Result<bool> {
|
||||
Ok(auth::has_user(user).await?)
|
||||
}
|
||||
|
||||
/// Get a copy of the list of all user credentials
|
||||
// invoke('auth_users',user)
|
||||
// invoke('plugin:auth|auth_users',user)
|
||||
#[tauri::command]
|
||||
pub async fn auth_users() -> Result<Vec<Credentials>> {
|
||||
Ok(auth::users().await?)
|
||||
@@ -49,7 +65,7 @@ pub async fn auth_users() -> Result<Vec<Credentials>> {
|
||||
|
||||
/// Get a user from the UUID
|
||||
/// Prefer to use refresh instead, as it will refresh the credentials as well
|
||||
// invoke('auth_users',user)
|
||||
// invoke('plugin:auth|auth_users',user)
|
||||
#[tauri::command]
|
||||
pub async fn auth_get_user(user: uuid::Uuid) -> Result<Credentials> {
|
||||
Ok(auth::get_user(user).await?)
|
||||
|
||||
Reference in New Issue
Block a user