{"size": 293, "ext": "js", "max_stars_repo_path": "server/util/getToken.js", "max_stars_repo_name": "belminkor/uspomene", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/util/getToken.js", "max_issues_repo_name": "belminkor/uspomene", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/util/getToken.js", "max_forks_repo_name": "belminkor/uspomene", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.9285714286, "max_line_length": 52, "alphanum_fraction": 0.6450511945}
import passport from 'passport';
require('./passport')(passport);

// get token
export function getToken(headers) {
  if (headers && headers.authorization) {
    const parted = headers.authorization.split(' ');
    if (parted.length === 2) {
      return parted[1];
    }
  }
  return null;
}
