scragg0x / realms-wiki

Git based wiki inspired by Gollum
http://realms.io
GNU General Public License v2.0
833 stars 91 forks source link

Use github's anonymous email when github auth user has private email #160

Closed gazpachoking closed 7 years ago

gazpachoking commented 7 years ago

Github has an option to keep your email address private. When an user logs in via github oauth, currently all of their edits will have anon@anon.anon email. When viewing the wiki repo history in github this all gets interpreted as one user. This commit sets the email for github users with private email addresses to <username>@users.noreply.github.com, which github recognizes as belonging to the proper user.

Instead of making conditionals in the class, I just added the ability for the field maps to contain lambda functions.