Software / code / prosody
Comparison
plugins/mod_tokenauth.lua @ 13274:ddfe07041fc5
mod_tokenauth: Periodically clear out expired tokens and grants
This should ensure expired grants eventually disappear.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 09 Oct 2023 20:31:35 +0200 |
| parent | 13273:a1c927323f06 |
| child | 13275:5db61e0dfc62 |
comparison
equal
deleted
inserted
replaced
| 13273:a1c927323f06 | 13274:ddfe07041fc5 |
|---|---|
| 339 sasl.resource = resource; | 339 sasl.resource = resource; |
| 340 sasl.token_info = token_info; | 340 sasl.token_info = token_info; |
| 341 return token_user, true, token_info; | 341 return token_user, true, token_info; |
| 342 end; | 342 end; |
| 343 end | 343 end |
| 344 | |
| 345 module:daily(function() | |
| 346 for username in token_store:items() do | |
| 347 get_user_grants(username); -- clears out expired grants | |
| 348 end | |
| 349 end) |