aboutsummaryrefslogtreecommitdiff
path: root/azalea-auth/examples/auth.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-auth/examples/auth.rs')
-rw-r--r--azalea-auth/examples/auth.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/azalea-auth/examples/auth.rs b/azalea-auth/examples/auth.rs
new file mode 100644
index 00000000..8f7cf7f9
--- /dev/null
+++ b/azalea-auth/examples/auth.rs
@@ -0,0 +1,19 @@
+use std::path::PathBuf;
+
+#[tokio::main]
+async fn main() {
+ env_logger::init();
+
+ let cache_file = PathBuf::from("example_cache.json");
+
+ let auth_result = azalea_auth::auth(
+ "example@example.com",
+ azalea_auth::AuthOpts {
+ cache_file: Some(cache_file),
+ ..Default::default()
+ },
+ )
+ .await
+ .unwrap();
+ println!("{:?}", auth_result);
+}