Software /
code /
prosody-modules
Changeset
5526:46e512f4ba14
mod_http_oauth2: Simplify template using if-falsy operator
Relies on Prosody rev af1e3b7d9ea3 which added the {var~if-falsy},
released in 0.12. Since this module requires trunk this is fine.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 07 Jun 2023 12:54:52 +0200 |
parents | 5525:87268f4e6a2e |
children | 5527:5268049915d8 |
files | mod_http_oauth2/html/login.html mod_http_oauth2/mod_http_oauth2.lua |
diffstat | 2 files changed, 1 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_http_oauth2/html/login.html Wed Jun 07 12:31:52 2023 +0200 +++ b/mod_http_oauth2/html/login.html Wed Jun 07 12:54:52 2023 +0200 @@ -16,7 +16,7 @@ <p>{state.error}</p> </div>} <form method="post"> - <input type="text" name="username" placeholder="Username" aria-label="Username" required {extra.no_username_hint&autofocus}{extra.username_hint& value="{extra.username_hint?}"}><br/> + <input type="text" name="username" placeholder="Username" aria-label="Username" required {extra.username_hint~autofocus}{extra.username_hint& value="{extra.username_hint?}"}><br/> <input type="password" name="password" placeholder="Password" aria-label="Password" autocomplete="current-password" required {extra.username_hint&autofocus}><br/> <input type="submit" value="Sign in"> </form>
--- a/mod_http_oauth2/mod_http_oauth2.lua Wed Jun 07 12:31:52 2023 +0200 +++ b/mod_http_oauth2/mod_http_oauth2.lua Wed Jun 07 12:54:52 2023 +0200 @@ -801,7 +801,6 @@ local extra = {}; if params.login_hint then extra.username_hint = (jid.prepped_split(params.login_hint)); - extra.no_username_hint = not extra.username_hint; end return render_page(templates.login, { state = auth_state; client = client; extra = extra }); elseif auth_state.consent == nil then