comparison mod_http_oauth2/mod_http_oauth2.lua @ 5764:87920d436cb4

mod_http_oauth2: Handle login_hint without @hostpart Makes life easier for the client when it does not know the full JID, which might not have the same hostpart as the authorization server URL.
author Kim Alvefur <zash@zash.se>
date Sun, 03 Dec 2023 15:07:50 +0100
parents c27eaa7117d6
children b8a2b3ebe792
comparison
equal deleted inserted replaced
5763:6c0570a8b866 5764:87920d436cb4
893 end 893 end
894 894
895 -- Render login page 895 -- Render login page
896 local extra = {}; 896 local extra = {};
897 if params.login_hint then 897 if params.login_hint then
898 extra.username_hint = (jid.prepped_split(params.login_hint)); 898 extra.username_hint = (jid.prepped_split(params.login_hint) or encodings.stringprep.nodeprep(params.login_hint));
899 elseif not prompt:contains("select_account") then 899 elseif not prompt:contains("select_account") then
900 -- TODO If the login page is split into account selection followed by login 900 -- TODO If the login page is split into account selection followed by login
901 -- (e.g. password), and then the account selection could be skipped iff the 901 -- (e.g. password), and then the account selection could be skipped iff the
902 -- 'login_hint' parameter is present. 902 -- 'login_hint' parameter is present.
903 return error_response(request, redirect_uri, oauth_error("account_selection_required")); 903 return error_response(request, redirect_uri, oauth_error("account_selection_required"));