// This pattern is not the cleanest. But so that we don't have to create
// another GWT serializable wrapper type, we reuse the TaskData type and
// simply special case the first entry in the returned array to have
// meta data about the logged in user.
Task metaTask = new Task();
metaTask.setEmail(email);
metaTask.setDetails(userService.createLogoutURL(
userService.createLoginURL(getAppUrl())));
detachedTasks.add(0, metaTask);
return detachedTasks.toArray(new Task[0]);
} else {
return null;