Last active
August 29, 2015 14:26
-
-
Save meeDamian/9f592d6f3b370693ad7e to your computer and use it in GitHub Desktop.
I do know that's evil
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
class AuthTranslator | |
constructor: (profile) -> | |
@name = {} | |
{ | |
@id | |
@provider | |
@gender | |
@profileUrl | |
displayName: @name.display | |
name: | |
givenName: @name.first | |
familyName: @name.last | |
_json: | |
bio: @desc | |
email: @email | |
} = profile | |
[@lang, @locale] = profile._json.locale.split '_' | |
@_profile = @_profile ? {} | |
@_profile.auth = profile._json | |
module.exports = | |
auth: AuthTranslator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment