mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-04 12:51:12 -05:00
27 lines
705 B
CoffeeScript
27 lines
705 B
CoffeeScript
CocoClass = require 'lib/CocoClass'
|
|
{me} = require 'lib/auth'
|
|
{backboneFailure} = require 'lib/errors'
|
|
storage = require 'lib/storage'
|
|
|
|
|
|
module.exports = LinkedInHandler = class LinkedInHandler extends CocoClass
|
|
constructor: ->
|
|
super()
|
|
|
|
subscriptions:
|
|
'linkedin-loaded': 'onLinkedInLoaded'
|
|
|
|
onLinkedInLoaded: (e) ->
|
|
IN.Event.on IN, "auth", @onLinkedInAuth
|
|
|
|
onLinkedInAuth: (e) => console.log "Authorized with LinkedIn"
|
|
|
|
constructEmployerAgreementObject: (cb) =>
|
|
IN.API.Profile("me")
|
|
.fields(["positions","public-profile-url","id","first-name","last-name","email-address"])
|
|
.error(cb)
|
|
.result (profiles) =>
|
|
cb null, profiles.values[0]
|
|
|
|
destroy: ->
|
|
super()
|