iLoader provides several Tauri commands to manage Apple account authentication and session state. You can perform new logins, restore stored credentials, delete accounts, and check the current login status.
Login Methods
login_new: Performs a fresh login. If save_credentials is set to true, the password is saved to the system keyring and the email is added to the local data.json store.login_stored: Retrieves credentials from the system keyring using the provided email and performs a login.
Session Management
logged_in_as: Returns the email address of the currently logged-in user, or None if no session exists.invalidate_account: Clears the current active session.delete_account: Removes an account's credentials from the system keyring and removes its email from the local data.json store.
Anisette State
reset_anisette_state: Deletes the stored Anisette state from the system keyring. This is useful for troubleshooting authentication issues related to the Anisette provider.
// Example of how these commands are structured as Tauri commands
#[tauri::command]
pub async fn login_new(
handle: AppHandle,
window: Window,
sideloader_state: State<'_, SideloaderMutex>,
email: String,
password: String,
anisette_server: String,
save_credentials: bool,
) -> Result<(), AppError> { ... }