summaryrefslogtreecommitdiff
path: root/examples/simple_example.js
diff options
context:
space:
mode:
authorkotontrion <[email protected]>2024-05-19 19:15:09 +0200
committerkotontrion <[email protected]>2024-05-19 19:15:09 +0200
commit2308e485ec479dd120baf4496b839612eb96aaa0 (patch)
treebeb0e26820c512e702509427d90132c41ca5b45c /examples/simple_example.js
parentdf48cbd0695f1145fde13da10dbe596f8a09822e (diff)
add: Readme and gjs examples
Diffstat (limited to 'examples/simple_example.js')
-rw-r--r--examples/simple_example.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/simple_example.js b/examples/simple_example.js
new file mode 100644
index 0000000..2bf38c1
--- /dev/null
+++ b/examples/simple_example.js
@@ -0,0 +1,9 @@
+#!/usr/bin/env -S gjs -m
+import Auth from "gi://AstalAuth";
+import Gio from "gi://Gio";
+
+Gio._promisify(Auth.Pam, "authenticate");
+
+await Auth.Pam.authenticate("password")
+ .then(_ => print("authentication sucessful"))
+ .catch(logError); \ No newline at end of file