{"size": 446, "ext": "js", "max_stars_repo_path": "exercise.js", "max_stars_repo_name": "davidpolaniaac/javascript-jest", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "exercise.js", "max_issues_repo_name": "davidpolaniaac/javascript-jest", "max_issues_repo_issues_event_min_datetime": "2021-05-11T18:58:23.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-11T18:58:23.000Z", "max_forks_repo_path": "exercise.js", "max_forks_repo_name": "davidpolaniaac/javascript-jest", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 22.3, "max_line_length": 57, "alphanum_fraction": 0.6233183857}
import axios from 'axios';

const api = 'https://rickandmortyapi.com/api/character/';

export async function getUserAuthorization(idUser) {

    let permission = false;
    const response = await axios.get(api + idUser);
    const { id, name, status } = response.data;
    if (status == 'Alive') {
        permission = true;
    }
    const userAuthorization = {
        id,
        name,
        permission
    }

    return userAuthorization;
}