mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Throw if we cant sign the request
This commit is contained in:
parent
3fed16d936
commit
59852a1565
1 changed files with 4 additions and 1 deletions
|
|
@ -78,9 +78,12 @@ class ScoreClientImpl implements ScoreClient {
|
|||
|
||||
async getScores(data: ScoreApiRequestBody): Promise<ScoreApiResponse> {
|
||||
const start = Date.now()
|
||||
const authToken = await createWebAuthToken(data.user_id)
|
||||
|
||||
try {
|
||||
const authToken = await createWebAuthToken(data.user_id)
|
||||
if (!authToken) {
|
||||
throw Error('could not create auth token')
|
||||
}
|
||||
const response = await axios.post<ScoreApiResponse>(this.apiUrl, data, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${authToken}`,
|
||||
|
|
|
|||
Loading…
Reference in a new issue