Software /
code /
prosody
Comparison
plugins/mod_tokenauth.lua @ 13356:bbbda8819331
mod_tokenauth: Ignore invalid grants in storage that have no id
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 29 Nov 2023 17:51:34 +0000 |
parent | 13321:19c814d4dd3a |
child | 13638:94462d8f2fa9 |
comparison
equal
deleted
inserted
replaced
13355:a6c8a50cdfb5 | 13356:bbbda8819331 |
---|---|
143 | 143 |
144 local function _get_validated_grant_info(username, grant) | 144 local function _get_validated_grant_info(username, grant) |
145 if type(grant) == "string" then | 145 if type(grant) == "string" then |
146 grant = token_store:get_key(username, grant); | 146 grant = token_store:get_key(username, grant); |
147 end | 147 end |
148 if not grant or not grant.created then return nil; end | 148 if not grant or not grant.created or not grant.id then return nil; end |
149 | 149 |
150 -- Invalidate grants from before last password change | 150 -- Invalidate grants from before last password change |
151 local account_info = usermanager.get_account_info(username, module.host); | 151 local account_info = usermanager.get_account_info(username, module.host); |
152 local password_updated_at = account_info and account_info.password_updated; | 152 local password_updated_at = account_info and account_info.password_updated; |
153 local now = os.time(); | 153 local now = os.time(); |