Skip to content

Commit

Permalink
Fix: Lemmy 0.19 synchronization (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
RikudouSage authored Feb 10, 2024
1 parent bd56042 commit 5b7bc0f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/services/lemmy-api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ export class LemmyApiService {
public isCurrentUserAdmin(instance: string, jwt: string): Observable<boolean> {
const url = `https://${instance}/api/v3/site?auth=${jwt}`;

return this.httpClient.get<GetSiteResponse>(url).pipe(
return this.httpClient.get<GetSiteResponse>(url, {
headers: {
authorization: `Bearer ${jwt}`,
},
}).pipe(
map (response => {
const currentUsername = response.my_user.local_user_view.person.name;
const admins = response.admins.map(user => user.person.name);
Expand All @@ -65,6 +69,10 @@ export class LemmyApiService {
return this.httpClient.put(url, {
blocked_instances: newInstancesToBlock,
auth: jwt,
}, {
headers: {
authorization: `Bearer ${jwt}`,
},
}).pipe(map(() => {return}));
}
}

0 comments on commit 5b7bc0f

Please sign in to comment.