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:
Shawn O. Pearce
2009-08-18 18:31:51 -07:00
parent 7307fea23c
commit 8cda676408
2 changed files with 2 additions and 2 deletions

View File

@@ -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(',');
}

View File

@@ -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(',');
}