Mercurial > prosody-modules
comparison mod_client_management/mod_client_management.lua @ 5306:210aeb5afe42
mod_client_management: Fail to revoke clients that have used passwords
Return an error so the caller can take appropriate action, e.g. encouraging
the user to change their password.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 05 Apr 2023 19:45:13 +0100 |
| parents | 9b9f35aaeb91 |
| children | 2bb27dfd10d5 |
comparison
equal
deleted
inserted
replaced
| 5305:9b9f35aaeb91 | 5306:210aeb5afe42 |
|---|---|
| 292 end | 292 end |
| 293 if status.grant then | 293 if status.grant then |
| 294 local ok = tokenauth.revoke_grant(username, status.grant.id); | 294 local ok = tokenauth.revoke_grant(username, status.grant.id); |
| 295 if not ok then return nil, "internal-server-error"; end | 295 if not ok then return nil, "internal-server-error"; end |
| 296 end | 296 end |
| 297 if status.password then | |
| 298 return nil, "password-reset-required"; | |
| 299 end | |
| 297 return true; | 300 return true; |
| 298 elseif c_type == "grant" then | 301 elseif c_type == "grant" then |
| 299 local grant = tokenauth.get_grant_info(username, c_id); | 302 local grant = tokenauth.get_grant_info(username, c_id); |
| 300 if not grant then | 303 if not grant then |
| 301 return nil, "item-not-found"; | 304 return nil, "item-not-found"; |
