summaryrefslogtreecommitdiff
path: root/auth/examples/simple_example.c
diff options
context:
space:
mode:
authorAylur <[email protected]>2024-09-01 14:17:36 +0200
committerAylur <[email protected]>2024-09-01 14:17:36 +0200
commit3e3f045d650a839d21f7b649da7aa5c19bd2e38b (patch)
tree9a974eb0d38932d474940288c662bd1f01ea3088 /auth/examples/simple_example.c
parent408faee16911ccfaa3e7dad69f9938fd4a696704 (diff)
monorepo structuring
Diffstat (limited to 'auth/examples/simple_example.c')
-rw-r--r--auth/examples/simple_example.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/auth/examples/simple_example.c b/auth/examples/simple_example.c
deleted file mode 100644
index d00bad2..0000000
--- a/auth/examples/simple_example.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <bsd/readpassphrase.h>
-
-#include "astal-auth.h"
-
-GMainLoop *loop;
-
-void ready_callback(AstalAuthPam *pam, GAsyncResult *res, gpointer user_data) {
- GError *error = NULL;
- astal_auth_pam_authenticate_finish(res, &error);
- if (error == NULL) {
- g_print("success\n");
- } else {
- g_print("failure: %s\n", error->message);
- g_error_free(error);
- }
-
- g_main_loop_quit(loop);
-}
-
-int main(void) {
- GMainContext *loopctx = NULL;
- loop = g_main_loop_new(loopctx, FALSE);
-
- gchar *passbuf = calloc(1024, sizeof(gchar));
- readpassphrase("Password: ", passbuf, 1024, RPP_ECHO_OFF);
- astal_auth_pam_authenticate(passbuf, (GAsyncReadyCallback)ready_callback, NULL);
- g_free(passbuf);
-
- g_main_loop_run(loop);
- exit(EXIT_SUCCESS);
-}