@navservice/core 1.124.0 → 1.127.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/es/helpers.js
CHANGED
|
@@ -663,7 +663,7 @@ const _token = new class {
|
|
|
663
663
|
usuario_id: usuario_id
|
|
664
664
|
}).setProtectedHeader({
|
|
665
665
|
alg: "HS256"
|
|
666
|
-
}).setIssuedAt().setExpirationTime("2h").sign(new TextEncoder().encode(await env.JSON_WEB_REFRESH_TOKEN_AUTH_USER
|
|
666
|
+
}).setIssuedAt().setExpirationTime("2h").sign(new TextEncoder().encode(await env.JSON_WEB_REFRESH_TOKEN_AUTH_USER?.get())).catch((error)=>_set_response.error.TOKEN_AUTH_USER({
|
|
667
667
|
message: "Erro ao gerar refresh token!",
|
|
668
668
|
fn: _token_fn
|
|
669
669
|
}));
|
|
@@ -671,7 +671,7 @@ const _token = new class {
|
|
|
671
671
|
}
|
|
672
672
|
async verificar_refresh_token({ env, refresh_token }) {
|
|
673
673
|
try {
|
|
674
|
-
const secret_verify = new TextEncoder().encode(await env.JSON_WEB_REFRESH_TOKEN_AUTH_USER
|
|
674
|
+
const secret_verify = new TextEncoder().encode(await env.JSON_WEB_REFRESH_TOKEN_AUTH_USER?.get());
|
|
675
675
|
const { payload } = await jwtVerify(refresh_token, secret_verify);
|
|
676
676
|
return payload;
|
|
677
677
|
} catch (error) {
|
|
@@ -14,7 +14,7 @@ declare namespace t {
|
|
|
14
14
|
Bindings: {
|
|
15
15
|
JSON_WEB_TOKEN_AUTH_USER: SecretsStoreSecret;
|
|
16
16
|
JSON_WEB_TOKEN_AUTH_MICRO_SERVICO: SecretsStoreSecret;
|
|
17
|
-
JSON_WEB_REFRESH_TOKEN_AUTH_USER
|
|
17
|
+
JSON_WEB_REFRESH_TOKEN_AUTH_USER?: SecretsStoreSecret;
|
|
18
18
|
};
|
|
19
19
|
Variables: {
|
|
20
20
|
usuario_auth: TypeControllerUsuario.TokenPayload;
|
package/build/lib/helpers.cjs
CHANGED
|
@@ -753,7 +753,7 @@ const _token = new class _token {
|
|
|
753
753
|
usuario_id: usuario_id
|
|
754
754
|
}).setProtectedHeader({
|
|
755
755
|
alg: "HS256"
|
|
756
|
-
}).setIssuedAt().setExpirationTime("2h").sign(new TextEncoder().encode(await env.JSON_WEB_REFRESH_TOKEN_AUTH_USER
|
|
756
|
+
}).setIssuedAt().setExpirationTime("2h").sign(new TextEncoder().encode(await env.JSON_WEB_REFRESH_TOKEN_AUTH_USER?.get())).catch((error)=>{
|
|
757
757
|
return _set_response.error.TOKEN_AUTH_USER({
|
|
758
758
|
message: "Erro ao gerar refresh token!",
|
|
759
759
|
fn: _token_fn
|
|
@@ -764,7 +764,7 @@ const _token = new class _token {
|
|
|
764
764
|
async verificar_refresh_token({ env, refresh_token }) {
|
|
765
765
|
try {
|
|
766
766
|
if (!refresh_token) false;
|
|
767
|
-
const secret_verify = new TextEncoder().encode(await env.JSON_WEB_REFRESH_TOKEN_AUTH_USER
|
|
767
|
+
const secret_verify = new TextEncoder().encode(await env.JSON_WEB_REFRESH_TOKEN_AUTH_USER?.get());
|
|
768
768
|
const { payload } = await external_jose_namespaceObject.jwtVerify(refresh_token, secret_verify);
|
|
769
769
|
return payload;
|
|
770
770
|
} catch (error) {
|
|
@@ -14,7 +14,7 @@ declare namespace t {
|
|
|
14
14
|
Bindings: {
|
|
15
15
|
JSON_WEB_TOKEN_AUTH_USER: SecretsStoreSecret;
|
|
16
16
|
JSON_WEB_TOKEN_AUTH_MICRO_SERVICO: SecretsStoreSecret;
|
|
17
|
-
JSON_WEB_REFRESH_TOKEN_AUTH_USER
|
|
17
|
+
JSON_WEB_REFRESH_TOKEN_AUTH_USER?: SecretsStoreSecret;
|
|
18
18
|
};
|
|
19
19
|
Variables: {
|
|
20
20
|
usuario_auth: TypeControllerUsuario.TokenPayload;
|