Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

fix: stop forwarding jwt token to couchdb #30

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/couchdb/couch-db-client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ export class CouchDbClient {
}

private handleError(err: any) {
console.error(err);

if (err.response?.status === 401) {
throw new UnauthorizedException();
}
Expand All @@ -140,8 +142,6 @@ export class CouchDbClient {
if (err.response?.status === 404) {
throw new NotFoundException();
}

console.error(err);
throw new InternalServerErrorException();
}
}
2 changes: 1 addition & 1 deletion src/report/controller/report-calculation.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class ReportCalculationController {
@Headers('Authorization') token: string,
@Param('reportId') reportId: string,
): Observable<Reference> {
return this.reportStorage.fetchReport(new Reference(reportId), token).pipe(
return this.reportStorage.fetchReport(new Reference(reportId)).pipe(
switchMap((value) => {
if (!value) {
throw new NotFoundException();
Expand Down
2 changes: 2 additions & 0 deletions src/report/repository/report-repository.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ export class ReportRepository {
}

private handleError(err: any) {
console.error(err);

if (err.response.status === 401) {
throw new UnauthorizedException();
}
Expand Down
Loading