Made after-login redirect relative

Affects issues:
- Fixed #1479
This commit is contained in:
Risto Lahtela 2020-06-07 12:32:25 +03:00
parent 5749f6e7c2
commit fa7827d956

View File

@ -129,7 +129,7 @@ public class RequestHandler implements HttpHandler {
} else { } else {
String from = exchange.getRequestURI().toASCIIString(); String from = exchange.getRequestURI().toASCIIString();
response = Response.builder() response = Response.builder()
.redirectTo(StringUtils.startsWithAny(from, "/auth/", "/login") ? "/login" : "/login?from=" + from) .redirectTo(StringUtils.startsWithAny(from, "/auth/", "/login") ? "/login" : "/login?from=." + from)
.setHeader("Set-Cookie", "auth=expired; Path=/; Max-Age=1") .setHeader("Set-Cookie", "auth=expired; Path=/; Max-Age=1")
.build(); .build();
} }