Skip to content

Commit

Permalink
Merge pull request #538 from alex-shteinle/VCANDROID-1628-header-get-…
Browse files Browse the repository at this point in the history
…team-token-call

VCANDROID-1628 Add header to getMagistoTeamToken call
  • Loading branch information
anthonycr authored Feb 17, 2022
2 parents 3dfc14f + 6809d90 commit 569dde4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,10 @@ internal interface AuthService {
* @return A [VimeoCall] that provides a [TeamToken].
*/
@GET("auth/teams/{team_id}/magisto_access_token")
fun getMagistoTeamToken(@Path(value = "team_id") teamId: String): VimeoCall<TeamToken>
fun getMagistoTeamToken(
@Header(AUTHORIZATION) authorization: String,
@Path(value = "team_id") teamId: String
): VimeoCall<TeamToken>

companion object {
const val AUTHORIZATION = "Authorization"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,13 @@ internal class AuthenticatorImpl(
}

override fun getMagistoTeamToken(teamId: String, callback: VimeoCallback<TeamToken>): VimeoRequest {
return authService.getMagistoTeamToken(teamId).enqueue(callback)
val authorization = currentAccount?.accessToken?.let { "Bearer $it" } ?: authenticationMethod.basicAuthHeader
return authService
.getMagistoTeamToken(
authorization = authorization,
teamId = teamId
)
.enqueue(callback)
}

private fun VimeoCall<VimeoAccount>.enqueueWithAccountStore(callback: VimeoCallback<VimeoAccount>): VimeoRequest =
Expand Down

0 comments on commit 569dde4

Please sign in to comment.