Skip to content

Commit

Permalink
Optionally use personal token for DL urls
Browse files Browse the repository at this point in the history
  • Loading branch information
Morian Sonnet committed Sep 10, 2023
1 parent 7f97f87 commit 6ac0a42
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,10 @@ impl<U: UserProvider + PackageProvider + Send + Sync + 'static> Handler<U> {

// fetch the impersonation token for the user we'll embed
// the `dl` string.
let token = self.gitlab.fetch_token_for_user(self.user()?).await?;
let token = match &self.user()?.token {
None => self.gitlab.fetch_token_for_user(self.user()?).await?,
Some(token) => token.clone(),
};

// generate the config for the user, containing the download
// url template from gitlab and the impersonation token embedded
Expand Down

0 comments on commit 6ac0a42

Please sign in to comment.