summaryrefslogtreecommitdiff
path: root/users/app/designs
diff options
context:
space:
mode:
Diffstat (limited to 'users/app/designs')
-rw-r--r--users/app/designs/user/email_by_login_or_alias.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/users/app/designs/user/email_by_login_or_alias.js b/users/app/designs/user/email_by_login_or_alias.js
new file mode 100644
index 0000000..2a86d68
--- /dev/null
+++ b/users/app/designs/user/email_by_login_or_alias.js
@@ -0,0 +1,9 @@
+function(doc) {
+ if (doc.type != 'User') {
+ return;
+ }
+ emit(doc.login, doc.public_key);
+ doc.email_aliases.forEach(function(alias){
+ emit(alias.username, doc.public_key);
+ });
+}