Diff

plugins/mod_tokenauth.lua @ 12959:e331210beeb2

mod_tokenauth: Fix traceback in get_token_session() Errors in sha256 becasue `token_secret` is nil since it was not passed to _get_validated_token_info(). Looks like a simple oversight in ebe3b2f96cad
author Kim Alvefur <zash@zash.se>
date Tue, 21 Mar 2023 20:43:42 +0100
parent 12953:ebe3b2f96cad
child 12977:74b9e05af71e
line wrap: on
line diff
--- a/plugins/mod_tokenauth.lua	Tue Mar 21 18:59:19 2023 +0000
+++ b/plugins/mod_tokenauth.lua	Tue Mar 21 20:43:42 2023 +0100
@@ -117,13 +117,13 @@
 end
 
 function get_token_session(token, resource)
-	local token_id, token_user, token_host = parse_token(token);
+	local token_id, token_user, token_host, token_secret = parse_token(token);
 	if not token_id then
 		module:log("warn", "Failed to verify access token: %s", token_user);
 		return nil, "invalid-token-format";
 	end
 
-	local token_info, err = _get_validated_token_info(token_id, token_user, token_host);
+	local token_info, err = _get_validated_token_info(token_id, token_user, token_host, token_secret);
 	if not token_info then return nil, err; end
 
 	return {