SSO auth (1)
This commit is contained in:
@@ -8,45 +8,16 @@ pub async fn logout_and_restart() -> Result<(), String> {
|
||||
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn login(email: String, password: String) -> Result<(), String> {
|
||||
auth::login_and_init_session(&email, &password)
|
||||
pub async fn start_google_auth() -> Result<(), String> {
|
||||
auth::start_browser_login("google")
|
||||
.await
|
||||
.map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn register(
|
||||
email: String,
|
||||
password: String,
|
||||
name: Option<String>,
|
||||
username: Option<String>,
|
||||
) -> Result<String, String> {
|
||||
auth::register(
|
||||
&email,
|
||||
&password,
|
||||
name.as_deref(),
|
||||
username.as_deref(),
|
||||
)
|
||||
.await
|
||||
.map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn change_password(
|
||||
current_password: String,
|
||||
new_password: String,
|
||||
) -> Result<(), String> {
|
||||
auth::change_password(¤t_password, &new_password)
|
||||
.await
|
||||
.map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn reset_password(old_password: String, new_password: String) -> Result<(), String> {
|
||||
auth::reset_password(&old_password, &new_password)
|
||||
pub async fn start_discord_auth() -> Result<(), String> {
|
||||
auth::start_browser_login("discord")
|
||||
.await
|
||||
.map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user