uspot: fix userurl and allow cleartext password

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2023-03-06 09:37:17 +01:00
parent f1a56edd09
commit 5fec90d4ca
2 changed files with 5 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
Status: 302 Found
Location: http://{{env.SERVER_ADDR}}/hotspot/?redir={{env.headers.host}}
Location: http://{{env.SERVER_ADDR}}/hotspot/?redir={{env.headers.host}}{{env.REQUEST_URI}}
Content-Type: text/html

View File

@@ -13,7 +13,10 @@ function auth_client(ctx) {
let payload = portal.radius_init(ctx);
payload.logoff_url = sprintf('http://%s:3990/', ctx.env.SERVER_ADDR);
if (ctx.query_string.username && ctx.query_string.response) {
if (ctx.query_string.username && ctx.query_string.password && !portal.config.uam.uam_secret) {
payload.username = ctx.query_string.username;
payload.password = ctx.query_string.password;
} else if (ctx.query_string.username && ctx.query_string.response) {
let challenge = uam.md5(portal.config.uam.challenge, ctx.format_mac);
payload.username = ctx.query_string.username;