Merge branch 'stable-2.14' into stable-2.15

* stable-2.14:
  Fixing registration redirect for new OpenID users

Change-Id: Iaa8bb74586f10242ac7363cb039f3665b5f6d087
This commit is contained in:
David Pursehouse 2018-02-09 08:46:53 +09:00
commit ff0851edd3

View File

@ -487,10 +487,15 @@ class OpenIdServiceImpl {
final StringBuilder rdr = new StringBuilder(); final StringBuilder rdr = new StringBuilder();
rdr.append(urlProvider.get(req)); rdr.append(urlProvider.get(req));
String nextToken = Url.decode(token);
if (isNew && !token.startsWith(PageLinks.REGISTER + "/")) { if (isNew && !token.startsWith(PageLinks.REGISTER + "/")) {
rdr.append('#' + PageLinks.REGISTER); rdr.append('#' + PageLinks.REGISTER);
if (nextToken.startsWith("#")) {
// Need to strip the leading # off the token to fix registration page redirect
nextToken = nextToken.substring(1);
}
} }
rdr.append(Url.decode(token)); rdr.append(nextToken);
rsp.sendRedirect(rdr.toString()); rsp.sendRedirect(rdr.toString());
} }