Skip to content

Commit

Permalink
add whitespace for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
PietrH committed Apr 2, 2024
1 parent 8055e72 commit e801285
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions R/get_access_token.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ get_access_token <-
# check input params

assertthat::assert_that(assertthat::is.flag(quiet))

# check for keyring support
assertthat::assert_that(keyring::has_keyring_support())

Check warning on line 28 in R/get_access_token.R

View check run for this annotation

Codecov / codecov/patch

R/get_access_token.R#L28

Added line #L28 was not covered by tests

# check if a keyring exists
iasset_keyring_exists <-
"iasset_password" %in% dplyr::pull(keyring::key_list(), "service")

Check warning on line 32 in R/get_access_token.R

View check run for this annotation

Codecov / codecov/patch

R/get_access_token.R#L31-L32

Added lines #L31 - L32 were not covered by tests

## check if a username is set
iasset_username_missing <- !rlang::is_string(get_username())

Check warning on line 35 in R/get_access_token.R

View check run for this annotation

Codecov / codecov/patch

R/get_access_token.R#L35

Added line #L35 was not covered by tests

Expand Down Expand Up @@ -60,6 +63,7 @@ get_access_token <-

# fetch the username, we'll fetch the password in line to avoid storing it
username <- get_username()

Check warning on line 65 in R/get_access_token.R

View check run for this annotation

Codecov / codecov/patch

R/get_access_token.R#L65

Added line #L65 was not covered by tests

# check that the fetched username is a string
assertthat::assert_that(assertthat::is.string(username))

Check warning on line 68 in R/get_access_token.R

View check run for this annotation

Codecov / codecov/patch

R/get_access_token.R#L68

Added line #L68 was not covered by tests

Expand All @@ -76,10 +80,12 @@ get_access_token <-
) %>%
httr2::req_perform() %>%
httr2::resp_body_json(check_type = FALSE)

# print success
if (!quiet) {
message(login_response$returndata[[1]]$success_msg)
}

# return access token
invisible(purrr::chuck(login_response, "returndata", 1, "access_token"))
}

0 comments on commit e801285

Please sign in to comment.