mirror of
https://github.com/google/nomulus
synced 2026-02-05 20:41:08 +00:00
Clarify optional vs. required fields
Added a separator between the fields, and marked required fields as "required", so you can't submit without them Also - changed from base64 to base58 in for the auto-generated password. It's conceivable that someone might need to read it outloud to someone else - and not having "visually similar" characters (like O and 0) can be helpful. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=228810158
This commit is contained in:
@@ -95,7 +95,7 @@ public final class ConsoleOteSetupAction implements Runnable {
|
||||
@Inject SendEmailUtils sendEmailUtils;
|
||||
@Inject @Config("logoFilename") String logoFilename;
|
||||
@Inject @Config("productName") String productName;
|
||||
@Inject @Config("base64StringGenerator") StringGenerator passwordGenerator;
|
||||
@Inject @Config("base58StringGenerator") StringGenerator passwordGenerator;
|
||||
@Inject @Parameter("clientId") Optional<String> clientId;
|
||||
@Inject @Parameter("email") Optional<String> email;
|
||||
@Inject @Parameter("password") Optional<String> optionalPassword;
|
||||
@@ -163,14 +163,12 @@ public final class ConsoleOteSetupAction implements Runnable {
|
||||
}
|
||||
|
||||
private void runPost(HashMap<String, Object> data) {
|
||||
// This is intentionally outside of the "try/catch", since not having these fields means someone
|
||||
// tried to "manually" POST to this page. No need to send out a "pretty" result in that case.
|
||||
checkState(clientId.isPresent() && email.isPresent(), "Must supply clientId and email");
|
||||
|
||||
data.put("baseClientId", clientId.get());
|
||||
data.put("contactEmail", email.get());
|
||||
|
||||
try {
|
||||
checkState(clientId.isPresent() && email.isPresent(), "Must supply clientId and email");
|
||||
|
||||
data.put("baseClientId", clientId.get());
|
||||
data.put("contactEmail", email.get());
|
||||
|
||||
String password = optionalPassword.orElse(passwordGenerator.createString(PASSWORD_LENGTH));
|
||||
ImmutableMap<String, String> clientIdToTld =
|
||||
OteAccountBuilder.forClientId(clientId.get())
|
||||
|
||||
Reference in New Issue
Block a user