Mercurial > prosody-hg
comparison 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 |
| parents | ebe3b2f96cad |
| children | 74b9e05af71e |
comparison
equal
deleted
inserted
replaced
| 12958:640476114eb6 | 12959:e331210beeb2 |
|---|---|
| 115 end | 115 end |
| 116 return _get_validated_token_info(token_id, token_user, token_host, token_secret); | 116 return _get_validated_token_info(token_id, token_user, token_host, token_secret); |
| 117 end | 117 end |
| 118 | 118 |
| 119 function get_token_session(token, resource) | 119 function get_token_session(token, resource) |
| 120 local token_id, token_user, token_host = parse_token(token); | 120 local token_id, token_user, token_host, token_secret = parse_token(token); |
| 121 if not token_id then | 121 if not token_id then |
| 122 module:log("warn", "Failed to verify access token: %s", token_user); | 122 module:log("warn", "Failed to verify access token: %s", token_user); |
| 123 return nil, "invalid-token-format"; | 123 return nil, "invalid-token-format"; |
| 124 end | 124 end |
| 125 | 125 |
| 126 local token_info, err = _get_validated_token_info(token_id, token_user, token_host); | 126 local token_info, err = _get_validated_token_info(token_id, token_user, token_host, token_secret); |
| 127 if not token_info then return nil, err; end | 127 if not token_info then return nil, err; end |
| 128 | 128 |
| 129 return { | 129 return { |
| 130 username = token_user; | 130 username = token_user; |
| 131 host = token_host; | 131 host = token_host; |
