Skip to content

Commit

Permalink
Added default apiKey when generating initial admin user
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Jul 26, 2010
1 parent a385cd1 commit 669da74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class EssentialDataCreator
public String password;
public String email;
public String name;
public String apiKey;

@In
AccountDAO accountDAO;
Expand Down Expand Up @@ -87,8 +88,10 @@ public void prepare()
log.info("No admin users found: creating default user 'admin'");

HAccount account = accountDAO.create(username, password, true);
account.setApiKey(apiKey);
account.getRoles().add(accountRoleDAO.findByName("admin"));
account.getRoles().add(accountRoleDAO.findByName("user"));
accountDAO.flush();
HPerson person = new HPerson();
person.setAccount(account);
person.setEmail(email);
Expand Down
1 change: 1 addition & 0 deletions flies-war/src/main/resources/META-INF/components.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<component name="essentialDataCreator" class="org.fedorahosted.flies.util.EssentialDataCreator" installed="true">
<property name="username">admin</property>
<property name="password">admin</property>
<property name="apiKey">b6d7044e9ee3b2447c28fb7c50d86d98</property>
<property name="email">[email protected]</property>
<property name="name">Administrator</property>
</component>
Expand Down

0 comments on commit 669da74

Please sign in to comment.