Skip to content

Commit

Permalink
fix(misc): linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bouassaba committed Oct 26, 2024
1 parent 12d3154 commit 87d2864
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion api/infra/file_identifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ package infra
import (
"archive/zip"
"encoding/json"
"github.com/kouprlabs/voltaserve/api/log"
"io"
"path/filepath"
"strings"

"github.com/kouprlabs/voltaserve/api/config"
"github.com/kouprlabs/voltaserve/api/log"
)

type FileIdentifier struct {
Expand Down
3 changes: 2 additions & 1 deletion conversion/identifier/file_identifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ package identifier
import (
"archive/zip"
"encoding/json"
"github.com/kouprlabs/voltaserve/conversion/infra"
"io"
"path/filepath"
"strings"

"github.com/kouprlabs/voltaserve/conversion/infra"
)

type FileIdentifier struct{}
Expand Down
12 changes: 5 additions & 7 deletions ui/src/client/idp/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type ExchangeOptions = {
}

export default class TokenAPI {
static async exchange(options: ExchangeOptions) {
static async exchange(options: ExchangeOptions): Promise<Token> {
const formBody = []
formBody.push(`grant_type=${options.grant_type}`)
if (options.grant_type === 'password') {
Expand Down Expand Up @@ -63,12 +63,10 @@ export default class TokenAPI {
},
false,
)
try {
if (response) {
return (await response.json()) as Token
}
} catch {
throw new Error('Failed to parse token')
if (response) {
return (await response.json()) as Token
} else {
throw new Error('Invalid token response')
}
}
}

0 comments on commit 87d2864

Please sign in to comment.