From a99642e492ccd6a37052b9d30a2b3c449d6baad7 Mon Sep 17 00:00:00 2001 From: matiasdodersidedrawer Date: Sun, 24 Oct 2021 22:10:58 -0300 Subject: [PATCH] version 17 --- package.json | 2 +- src/config.json | 7 ++++--- src/services/auth-service.ts | 3 +++ src/services/network-service.ts | 5 +++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 0349861..baae1f3 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "sidedrawer-javascript-sdk", "author": "Juan Matias Doder", "description": "This is a sdk of SideDrawer to help to build development quickly.", - "version": "0.1.16", + "version": "0.1.17", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", diff --git a/src/config.json b/src/config.json index f747d72..e1a0e8d 100644 --- a/src/config.json +++ b/src/config.json @@ -1,7 +1,8 @@ { - "apiRecord": "https://records-api.sidedrawer.com/api/v1/", - "apiNetwork": "https://networks-api.sidedrawer.com/api/v1/", - "apiUser": "https://user-api.sidedrawer.com/api/v1/", + + "apiRecord": "https://records-api-dev.sidedrawerdev.com/api/v1/", + "apiNetwork": "https://networks-api-dev.sidedrawerdev.com/api/v1/", + "apiUser": "https://user-api-dev.sidedrawerdev.com/api/v1/", "apiIdentifier": "https://user-api-stg.sidedrawer.com", "auth0Domain": "acc-stg.sidedrawer.com" } \ No newline at end of file diff --git a/src/services/auth-service.ts b/src/services/auth-service.ts index 45b818c..902e112 100644 --- a/src/services/auth-service.ts +++ b/src/services/auth-service.ts @@ -7,6 +7,9 @@ export const createAuthClient = async (client_id: string) => { return await createAuth0Client({ domain: config.auth0Domain, client_id: client_id, + scope: 'openid profile offline_access', + audience: 'https://user-api-stg.sidedrawer.com', + useRefreshTokens: true }); }; diff --git a/src/services/network-service.ts b/src/services/network-service.ts index b3bcb0b..1204bed 100644 --- a/src/services/network-service.ts +++ b/src/services/network-service.ts @@ -17,6 +17,7 @@ export const getShared = async () => { }; export const getOwned = async (token: string) => { - - return instance.get(`sidedrawer/owned`, { headers: { authorization: `Bearer ${token}` } }); + console.log(`Bearer nuevo ${token}`); + instance.defaults.headers.common['Authorization'] = `Bearer ${token}`; + return instance.get(`sidedrawer/owned`); };