Don't send users to #register,register,mine
If an account went missing during registration and gets recreated, don't generate a URL that goes through the registration screen a second time. Instead do it just once. This is a really contrived example that I can't see happening in real world usage, the only way I caused this was to delete my own user account and then hitting "reload" while on the registration screen for my prior account instance. Very unlikely to show up in a production server as users can't delete their accounts. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -99,7 +99,7 @@ class HttpLoginServlet extends HttpServlet {
|
||||
final StringBuilder rdr = new StringBuilder();
|
||||
rdr.append(urlProvider.get());
|
||||
rdr.append('#');
|
||||
if (arsp.isNew()) {
|
||||
if (arsp.isNew() && !token.startsWith(Link.REGISTER + ",")) {
|
||||
rdr.append(Link.REGISTER);
|
||||
rdr.append(',');
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ class OpenIdServiceImpl implements OpenIdService {
|
||||
final StringBuilder rdr = new StringBuilder();
|
||||
rdr.append(urlProvider.get());
|
||||
rdr.append('#');
|
||||
if (isNew) {
|
||||
if (isNew && !token.startsWith(Link.REGISTER + ",")) {
|
||||
rdr.append(Link.REGISTER);
|
||||
rdr.append(',');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user