changeset 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 6c0570a8b866
children 78368d2865dd
files mod_http_oauth2/mod_http_oauth2.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_oauth2/mod_http_oauth2.lua	Sat Dec 02 13:35:29 2023 +0100
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Sun Dec 03 15:07:50 2023 +0100
@@ -895,7 +895,7 @@
 		-- Render login page
 		local extra = {};
 		if params.login_hint then
-			extra.username_hint = (jid.prepped_split(params.login_hint));
+			extra.username_hint = (jid.prepped_split(params.login_hint) or encodings.stringprep.nodeprep(params.login_hint));
 		elseif not prompt:contains("select_account") then
 			-- TODO If the login page is split into account selection followed by login
 			-- (e.g. password), and then the account selection could be skipped iff the