Update token timestamp on auth verification
authorChip Black <bytex64@bytex64.net>
Fri, 25 Jul 2014 23:17:04 +0000 (18:17 -0500)
committerChip Black <bytex64@bytex64.net>
Fri, 25 Jul 2014 23:17:04 +0000 (18:17 -0500)
common/auth.c

index d460b41..240ac47 100644 (file)
@@ -380,6 +380,10 @@ int auth_check_token(const char *username, const char *given_token) {
                return 0;
        }
        ret = (stringring_find(sr, given_token, AUTHENTICATION_TIMEOUT) != -1);
+       if (ret == 1) {
+               /* Update token timestamp */
+               stringring_touch(sr, given_token);
+       }
        stringring_close(sr);
 
        return ret;