Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@seniorsistemas/senior-platform-data

Package Overview
Dependencies
Maintainers
2
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@seniorsistemas/senior-platform-data - npm Package Compare versions

Comparing version 5.3.0 to 5.4.0-3948b8b9-4b40-4774-8573-6c056416b10e

31

CHANGELOG.md

@@ -0,1 +1,28 @@

# {version}
[{date}]
### Quebras de compatibilidade
* N/A.
### Novas funcionalidades
* N/A.
### Melhorias
* N/A.
### Correções
* N/A.
### Alterações na base de dados
* N/A.
### Alteração de dependências
* N/A.
# 5.4.0
[22/12/2023]
### Novas funcionalidades
* [ARQPTF-6633](https://jira.senior.com.br/browse/ARQPTF-6633) - Criação das funções para salvar (setPreference) e buscar (getPreference) uma preferencia do usuário no indexedDB.
# 5.3.0

@@ -29,3 +56,3 @@ [11/12/2023]

### Quebras de compatibilidade
* [SRE-9011](http://jira.senior.com.br/browse/SRE-9011) - Adicionado o parâmetro opcional `useCache` na função `getUserData`. O valor padrão será `true`.
* [SRE-9011](http://jira.senior.com.br/browse/SRE-9011) - Adicionado o parâmetro opcional `useCache` na função `getUserData`. O valor padrão será `true`.

@@ -56,3 +83,3 @@ **NOTA**: O comportamento padrão será de utilizar o cache da resposta do `getUser` que terá o tempo de vida padrão de `1800000 milissegundos (30 minutos)`. Caso exista o item `SENIOR_USER_INFO_TTL` no localStorage, o ttl será pego de lá. Para não utilizar o cache, basta informar o parâmetro useCache com o valor `false`. É importante ressaltar que essas informações poderão estar desatualizadas em caso de alguma atualização do usuário ser feita no sistema, sendo necessário relogar.

* Alterado a chamada da api de `obterMeusDados` para `getUser`, no qual será necessário alterar a chamada das propriedades do objeto retornado pela função `getUserData`:
```

@@ -59,0 +86,0 @@ Retorno:

@@ -25,1 +25,6 @@ // Type definitions for @seniorsistemas/senior-platform-data

}
export namespace preference {
export function setPreference(preference: any): Promise<any>;
export function getPreference(onpreferenceIDj: any): Promise<any>;
}

2

dist/index.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("@seniorsistemas/senior-platform-data",[],t):"object"==typeof exports?exports["@seniorsistemas/senior-platform-data"]=t():e["@seniorsistemas/senior-platform-data"]=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(){return s.hasTabData()?s.getRestUrl():l.getServicesUrl().then(function(e){return e?e+"rest/":i.getRestUrl()})}Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.service=t.user=void 0;var a=r(2),i=n(a),u=r(3),s=n(u),c=r(4),l=n(c),f=r(6),d=new s.NewTabProvider,g=new i.IFrameProvider,m=new l.CookiesProvider,v=function(e){return s.hasTabData()?s.getToken():l.getServicesUrl().then(function(t){return t?l.getToken():e?Promise.reject():i.getToken()})};t.user={getToken:function(e){return v(e)},getAuthHeader:function(e){return(0,f.getAuthHeader)(v(e))},getUserData:function(e){return(0,f.getUserData)(o,v,e)},getRememberMe:l.getRememberMe},t.service={getRestUrl:o,getXServicesUrl:function(){if(s.hasTabData())return d.getXServicesUrl();var e=m.getXServicesUrl();return e||g.getXServicesUrl()},getSoapUrl:l.getSoapUrl,getODataUrl:l.getODataUrl},t.utils={getDomain:l.getDomain,getSelectedSub:l.getSelectedSub,getSelectedCompany:l.getSelectedCompany}},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return s||(console.warn("Senior Platform data not found. Waiting for message event..."),s=new Promise(function(e,t){setTimeout(function(){t(new Error("It was not possible to retrieve the Senior Platform data. Try to get a token on initialization."))},c),window.addEventListener("message",function(t){t.data&&t.data.token&&t.data.token.username&&t.data.token.token_type&&e(t.data)})})),s}function a(){return o().then(function(e){return e.servicesUrl})}function i(){return o().then(function(e){return e.token})}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.getRestUrl=a,t.getToken=i;var s=void 0,c=5e3;t.IFrameProvider=function(){function e(){n(this,e)}return u(e,[{key:"getXServicesUrl",value:function(){return o().then(function(e){return e.xServicesUrl})}}]),e}()},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return window&&window.name&&0===window.name.indexOf(s)}function a(){return Promise.resolve(c.servicesUrl)}function i(){return Promise.resolve(c.token)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.hasTabData=o,t.getRestUrl=a,t.getToken=i;var s=t.PREFIX="SENIOR_CREDENTIALS",c=o()?JSON.parse(window.name.substring(s.length)):{};t.NewTabProvider=function(){function e(){n(this,e)}return u(e,[{key:"getXServicesUrl",value:function(){return Promise.resolve(c.xServicesUrl)}}]),e}()},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return Promise.resolve(v.default.get("com.senior.services.url"))}function a(){return o().then(function(e){return e?e+"rest/":v.default.get("com.senior.pau.services.url")})}function i(){return o().then(function(e){return e?e+"soap/":v.default.get("com.senior.pau.soap.url")})}function u(){return o().then(function(e){return e?e+"odata/":v.default.get("com.senior.pau.odata.url")})}function s(){var e=JSON.parse(v.default.get("com.senior.token")||"{}");return Object.keys(e).length||(e=JSON.parse(JSON.parse(v.default.get("com.senior.pau.token")||'"{}"'))),Promise.resolve(e)}function c(){return Promise.resolve(v.default.get("com.senior.rememberme")||v.default.get("com.senior.pau.rememberme"))}function l(){return Promise.resolve(v.default.get("com.senior.domain")||v.default.get("com.senior.pau.domain"))}function f(){return Promise.resolve(v.default.get("com.senior.selectedSub")||v.default.get("com.senior.pau.selectedSub"))}function d(){return Promise.resolve(v.default.get("com.senior.selectedCompany")||v.default.get("com.senior.pau.selectedCompany"))}Object.defineProperty(t,"__esModule",{value:!0}),t.CookiesProvider=void 0;var g=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.getServicesUrl=o,t.getRestUrl=a,t.getSoapUrl=i,t.getODataUrl=u,t.getToken=s,t.getRememberMe=c,t.getDomain=l,t.getSelectedSub=f,t.getSelectedCompany=d;var m=r(5),v=function(e){return e&&e.__esModule?e:{default:e}}(m);t.CookiesProvider=function(){function e(){n(this,e)}return g(e,[{key:"getXServicesUrl",value:function(){return Promise.resolve(v.default.get("com.senior.x.services.url"))}}]),e}()},function(e,t){e.exports=require("js-cookie")},function(e,t,r){"use strict";function n(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=localStorage.getItem(s)||c;return Promise.all([e(),t()]).then(function(e){var t=o(e,2),a=t[0],s=t[1],c=null,l=localStorage.getItem(u);if(r&&l){var f=JSON.parse(l);if(f.data.username+"@"+f.data.tenantDomain===s.username&&f.ttl>Date.now())return new Promise(function(e){return e(f.data)});f.ttl<Date.now()&&(c=f.ETag)}return i.default.post(a+"platform/user/queries/getUser",{includePhoto:!0},{headers:{Authorization:s.token_type+" "+s.access_token,Accept:"application/json;seniorx.version=8","If-None-Match":c}}).then(function(e){var t=Date.now()+Number(n),r={data:e.data,ttl:t,ETag:e.headers.ETag};return 304===e.status&&(r.data=JSON.parse(l).data),localStorage.setItem(u,JSON.stringify(r)),r.data})})}Object.defineProperty(t,"__esModule",{value:!0}),t.getAuthHeader=void 0;var o=function(){function e(e,t){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw a}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.getUserData=n;var a=r(7),i=function(e){return e&&e.__esModule?e:{default:e}}(a),u="SENIOR_USER_INFO",s="SENIOR_USER_INFO_TTL",c="1800000";t.getAuthHeader=function(e){return e.then(function(e){return e&&Object.keys(e).length?e.token_type+" "+e.access_token:""})}},function(e,t){e.exports=require("axios")}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("@seniorsistemas/senior-platform-data",[],t):"object"==typeof exports?exports["@seniorsistemas/senior-platform-data"]=t():e["@seniorsistemas/senior-platform-data"]=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(){return c.hasTabData()?c.getRestUrl():f.getServicesUrl().then(function(e){return e?e+"rest/":i.getRestUrl()})}Object.defineProperty(t,"__esModule",{value:!0}),t.preference=t.utils=t.service=t.user=void 0;var u=r(2),i=n(u),a=r(3),c=n(a),s=r(4),f=n(s),l=r(6),d=n(l),v=r(9),m=new c.NewTabProvider,g=new i.IFrameProvider,p=new f.CookiesProvider,y=new d.IndexedDBProvider,b=function(e){return c.hasTabData()?c.getToken():f.getServicesUrl().then(function(t){return t?f.getToken():e?Promise.reject():i.getToken()})};t.user={getToken:function(e){return b(e)},getAuthHeader:function(e){return(0,v.getAuthHeader)(b(e))},getUserData:function(e){return(0,v.getUserData)(o,b,e)},getRememberMe:f.getRememberMe},t.service={getRestUrl:o,getXServicesUrl:function(){if(c.hasTabData())return m.getXServicesUrl();var e=p.getXServicesUrl();return e||g.getXServicesUrl()},getSoapUrl:f.getSoapUrl,getODataUrl:f.getODataUrl},t.utils={getDomain:f.getDomain,getSelectedSub:f.getSelectedSub,getSelectedCompany:f.getSelectedCompany},t.preference={setPreference:y.setPreference,getPreference:y.getPreference}},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return c||(console.warn("Senior Platform data not found. Waiting for message event..."),c=new Promise(function(e,t){setTimeout(function(){t(new Error("It was not possible to retrieve the Senior Platform data. Try to get a token on initialization."))},s),window.addEventListener("message",function(t){t.data&&t.data.token&&t.data.token.username&&t.data.token.token_type&&e(t.data)})})),c}function u(){return o().then(function(e){return e.servicesUrl})}function i(){return o().then(function(e){return e.token})}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.getRestUrl=u,t.getToken=i;var c=void 0,s=5e3;t.IFrameProvider=function(){function e(){n(this,e)}return a(e,[{key:"getXServicesUrl",value:function(){return o().then(function(e){return e.xServicesUrl})}}]),e}()},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return window&&window.name&&0===window.name.indexOf(c)}function u(){return Promise.resolve(s.servicesUrl)}function i(){return Promise.resolve(s.token)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.hasTabData=o,t.getRestUrl=u,t.getToken=i;var c=t.PREFIX="SENIOR_CREDENTIALS",s=o()?JSON.parse(window.name.substring(c.length)):{};t.NewTabProvider=function(){function e(){n(this,e)}return a(e,[{key:"getXServicesUrl",value:function(){return Promise.resolve(s.xServicesUrl)}}]),e}()},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return Promise.resolve(g.default.get("com.senior.services.url"))}function u(){return o().then(function(e){return e?e+"rest/":g.default.get("com.senior.pau.services.url")})}function i(){return o().then(function(e){return e?e+"soap/":g.default.get("com.senior.pau.soap.url")})}function a(){return o().then(function(e){return e?e+"odata/":g.default.get("com.senior.pau.odata.url")})}function c(){var e=JSON.parse(g.default.get("com.senior.token")||"{}");return Object.keys(e).length||(e=JSON.parse(JSON.parse(g.default.get("com.senior.pau.token")||'"{}"'))),Promise.resolve(e)}function s(){return Promise.resolve(g.default.get("com.senior.rememberme")||g.default.get("com.senior.pau.rememberme"))}function f(){return Promise.resolve(g.default.get("com.senior.domain")||g.default.get("com.senior.pau.domain"))}function l(){return Promise.resolve(g.default.get("com.senior.selectedSub")||g.default.get("com.senior.pau.selectedSub"))}function d(){return Promise.resolve(g.default.get("com.senior.selectedCompany")||g.default.get("com.senior.pau.selectedCompany"))}Object.defineProperty(t,"__esModule",{value:!0}),t.CookiesProvider=void 0;var v=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.getServicesUrl=o,t.getRestUrl=u,t.getSoapUrl=i,t.getODataUrl=a,t.getToken=c,t.getRememberMe=s,t.getDomain=f,t.getSelectedSub=l,t.getSelectedCompany=d;var m=r(5),g=function(e){return e&&e.__esModule?e:{default:e}}(m);t.CookiesProvider=function(){function e(){n(this,e)}return v(e,[{key:"getXServicesUrl",value:function(){return Promise.resolve(g.default.get("com.senior.x.services.url"))}}]),e}()},function(e,t){e.exports=require("js-cookie")},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.IndexedDBProvider=void 0;var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};r(7);var i=r(8),a=void 0,c=function e(t){try{var r={};return Object.keys(t).forEach(function(n){if(t[n]){var o=t[n].valueOf();d(o)?r[n]=e(o):r[n]=s(o,n).toString()}}),r}catch(e){console.error("Error:",e)}},s=function(e,t){return i.AES.encrypt(e,t.toString())},f=function e(t){var r={};return t?(Object.keys(t).forEach(function(n){var o=t[n].valueOf();d(o)?r[n]=e(o):r[n]=l(o,n)}),r):r},l=function(e,t){return i.AES.decrypt(e,t.toString()).toString(i.enc.Utf8)},d=function(e){return"object"===(void 0===e?"undefined":u(e))},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"readonly";return a.transaction(e,t)},m=function(){return new Promise(function(e,t){var r=indexedDB.open("platformDB",1);r.onupgradeneeded=function(){var t=r.result,n={keyPath:"username"};t.objectStoreNames.contains("userPreference")||t.createObjectStore("userPreference",n),e(t)},r.onerror=function(){t(new Error(r.error))},r.onsuccess=function(){e(r.result)}})};t.IndexedDBProvider=function(){function e(){n(this,e),this.createDB()}return o(e,[{key:"createDB",value:function(){m().then(function(e){a=e}).catch(function(e){console.error(e)})}},{key:"setPreference",value:function(e){return new Promise(function(t,r){var n=c(e.value),o={username:e.username,value:n},u=v("userPreference","readwrite"),i=u.objectStore("userPreference"),a=i.put(o);a.onsuccess=function(){t(a.result)},a.onerror=function(){r(new Error(a.error))}})}},{key:"getPreference",value:function(e){return new Promise(function(t,r){var n=v("userPreference"),o=n.objectStore("userPreference"),u=o.get(e);u.onsuccess=function(){var e=u.result?u.result.value:{},r=f(e);t(r)},u.onerror=function(){r(new Error(u.error))}})}}]),e}()},function(e,t){e.exports=require("regenerator-runtime/runtime")},function(e,t){e.exports=require("crypto-js")},function(e,t,r){"use strict";function n(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=localStorage.getItem(c)||s;return Promise.all([e(),t()]).then(function(e){var t=o(e,2),u=t[0],c=t[1],s=null,f=localStorage.getItem(a);if(r&&f){var l=JSON.parse(f);if(l.data.username+"@"+l.data.tenantDomain===c.username&&l.ttl>Date.now())return new Promise(function(e){return e(l.data)});l.ttl<Date.now()&&(s=l.ETag)}return i.default.post(u+"platform/user/queries/getUser",{includePhoto:!0},{headers:{Authorization:c.token_type+" "+c.access_token,Accept:"application/json;seniorx.version=8","If-None-Match":s}}).then(function(e){var t=Date.now()+Number(n),r={data:e.data,ttl:t,ETag:e.headers.ETag};return 304===e.status&&(r.data=JSON.parse(f).data),localStorage.setItem(a,JSON.stringify(r)),r.data})})}Object.defineProperty(t,"__esModule",{value:!0}),t.getAuthHeader=void 0;var o=function(){function e(e,t){var r=[],n=!0,o=!1,u=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{!n&&a.return&&a.return()}finally{if(o)throw u}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.getUserData=n;var u=r(10),i=function(e){return e&&e.__esModule?e:{default:e}}(u),a="SENIOR_USER_INFO",c="SENIOR_USER_INFO_TTL",s="1800000";t.getAuthHeader=function(e){return e.then(function(e){return e&&Object.keys(e).length?e.token_type+" "+e.access_token:""})}},function(e,t){e.exports=require("axios")}])});
{
"name": "@seniorsistemas/senior-platform-data",
"version": "5.3.0",
"version": "5.4.0-3948b8b9-4b40-4774-8573-6c056416b10e",
"description": "API para retornar valores dos usuários, atualmente retorna via cookies",

@@ -47,4 +47,6 @@ "project": {

"axios": "~0.17.1",
"js-cookie": "~2.2.0"
"crypto-js": "^4.2.0",
"js-cookie": "~2.2.0",
"regenerator-runtime": "^0.14.0"
}
}

@@ -20,2 +20,13 @@ # senior-platform-data

### **Utilização da API IndexedDB para salvar as preferências dos usuários**
Para utilizá-la no local desejado basta fazer o import:
`import { preference } from "@seniorsistemas/senior-platform-data";`
E após isso, chamar as funções, como por exemplo:
`preference.setPreference({ username: 'username', value: {preference1: value, preference2: value...} }).then(r => {console.log(r)}).catch(e => {console.error(e)})`
Todas as funções são assíncronas, tendo em mente que no futuro estas informações podem ser armazenadas em outro lugar ao invés de nos cookies.

@@ -41,2 +52,6 @@

* `preference`
* `setPreference()` - Insere uma preferência do usuário no IndexedDB
* `getPrefence()` - Retorna uma preferência do usuário
### **Integração para passagem credenciais na abertura de nova aba ou iframe**

@@ -48,3 +63,3 @@

### FAQ
Estou recebendo erro no console com a seguinte mensagem:
Estou recebendo erro no console com a seguinte mensagem:
"It was not possible to retrieve the Senior Platform data. Try to get a token on initialization.". O que devo fazer para funcionar?

@@ -56,3 +71,3 @@ Abaixo um exemplo para inicializar o token:

import { Observable, of } from 'rxjs';
@Injectable()

@@ -62,3 +77,3 @@ export class AppService {

constructor() {
//Inicializa o token da propriedade corrente.
//Inicializa o token da propriedade corrente.
user.getToken().then(data => this.token = data.token);

@@ -74,2 +89,2 @@ }

}
```
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc