Software /
code /
prosody-modules
Comparison
mod_http_oauth2/mod_http_oauth2.lua @ 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 |
parent | 5519:83ebfc367169 |
child | 5544:cb141088eff0 |
comparison
equal
deleted
inserted
replaced
5525:87268f4e6a2e | 5526:46e512f4ba14 |
---|---|
799 if not auth_state.user then | 799 if not auth_state.user then |
800 -- Render login page | 800 -- Render login page |
801 local extra = {}; | 801 local extra = {}; |
802 if params.login_hint then | 802 if params.login_hint then |
803 extra.username_hint = (jid.prepped_split(params.login_hint)); | 803 extra.username_hint = (jid.prepped_split(params.login_hint)); |
804 extra.no_username_hint = not extra.username_hint; | |
805 end | 804 end |
806 return render_page(templates.login, { state = auth_state; client = client; extra = extra }); | 805 return render_page(templates.login, { state = auth_state; client = client; extra = extra }); |
807 elseif auth_state.consent == nil then | 806 elseif auth_state.consent == nil then |
808 -- Render consent page | 807 -- Render consent page |
809 local scopes, roles = split_scopes(requested_scopes); | 808 local scopes, roles = split_scopes(requested_scopes); |