{"size": 574, "ext": "js", "max_stars_repo_path": "server/connectionLogin.js", "max_stars_repo_name": "Share911/login-links", "max_stars_repo_stars_event_min_datetime": "2016-04-17T22:42:43.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-05T17:01:54.000Z", "max_issues_repo_path": "server/connectionLogin.js", "max_issues_repo_name": "Share911/login-links", "max_issues_repo_issues_event_min_datetime": "2016-04-23T02:40:08.000Z", "max_issues_repo_issues_event_max_datetime": "2018-07-31T21:50:03.000Z", "max_forks_repo_path": "server/connectionLogin.js", "max_forks_repo_name": "Share911/login-links", "max_forks_repo_forks_event_min_datetime": "2016-05-20T10:19:41.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-08T12:56:42.000Z"}
{"max_stars_count": 76, "max_issues_count": 9, "max_forks_count": 13, "avg_line_length": 22.0769230769, "max_line_length": 67, "alphanum_fraction": 0.6411149826}
Meteor.methods({

  'login-links/connectionLogin': function (token) {
    let {user, savedToken} = LoginLinks._lookupToken(token)
    l('connectionLogin user:', user._id)

    if (Meteor.userId() === user._id)
      throw new Meteor.Error('login-links/already-fully-logged-in')

    this.setUserId(user._id)

    let data = _.omit(savedToken, 'hashedToken')

    for (let hook of LoginLinks._connectionHooks) {
      value = hook(savedToken, user)
      if (typeof value === 'object')
        _.extend(data, value)
    }

    data.userId = user._id

    return data
  }

})
