aboutsummaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-04-05 23:46:51 +0200
committerdefault <nobody@localhost>2023-04-05 23:46:51 +0200
commit1fe34ffb4a5b844bd32fd9146173366f09a32351 (patch)
treed7155bcb20b83b93a78adc570b1e154c81a2e5f6 /html.c
parent7c00a9918a961b46c555d67b4c6d729f34e36cac (diff)
New function lastlog_write().
Diffstat (limited to 'html.c')
-rw-r--r--html.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/html.c b/html.c
index 48672dd..9850dfd 100644
--- a/html.c
+++ b/html.c
@@ -13,11 +13,11 @@
#include "snac.h"
-int login(snac *snac, char *headers)
+int login(snac *snac, const xs_dict *headers)
/* tries a login */
{
int logged_in = 0;
- char *auth = xs_dict_get(headers, "authorization");
+ const char *auth = xs_dict_get(headers, "authorization");
if (auth && xs_startswith(auth, "Basic ")) {
int sz;
@@ -33,6 +33,9 @@ int login(snac *snac, char *headers)
}
}
+ if (logged_in)
+ lastlog_write(snac);
+
return logged_in;
}