Skip to content

Commit

Permalink
Merge pull request #51 from Dimillian/auth-getPopularFeedGenerators
Browse files Browse the repository at this point in the history
Forward the session authorization for getPopularFeedGenerators
  • Loading branch information
MasterJ93 authored Nov 21, 2024
2 parents 1d8b81b + f9b7989 commit 028bb01
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ extension ATProtoKit {
limit: Int? = 50,
cursor: String? = nil
) async throws -> AppBskyLexicon.Unspecced.GetPopularFeedGeneratorsOutput {
guard session != nil,
let accessToken = session?.accessToken else {
throw ATRequestPrepareError.missingActiveSession
}

guard let sessionURL = session?.pdsURL,
let requestURL = URL(string: "\(sessionURL)/xrpc/app.bsky.unspecced.getPopularFeedGenerators") else {
throw ATRequestPrepareError.invalidRequestURL
Expand Down Expand Up @@ -68,7 +73,7 @@ extension ATProtoKit {
andMethod: .get,
acceptValue: "application/json",
contentTypeValue: nil,
authorizationValue: nil
authorizationValue: "Bearer \(accessToken)"
)
let response = try await APIClientService.shared.sendRequest(
request,
Expand Down

0 comments on commit 028bb01

Please sign in to comment.