Compare commits

...

2 Commits

Author SHA1 Message Date
github-actions[bot]
b2cc1411d7 chore: update versions (#2571)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @nhost/apollo@6.0.8

### Patch Changes

-   @nhost/nhost-js@3.0.8

## @nhost/react-apollo@9.0.3

### Patch Changes

-   @nhost/apollo@6.0.8
-   @nhost/react@3.2.3

## @nhost/react-urql@6.0.3

### Patch Changes

-   @nhost/react@3.2.3

## @nhost/graphql-js@0.1.8

### Patch Changes

- 407feea: fix: replace `jwt-decode` with `jose` to decode access tokens
in a non browser environment

## @nhost/nextjs@2.1.5

### Patch Changes

-   @nhost/react@3.2.3

## @nhost/nhost-js@3.0.8

### Patch Changes

-   Updated dependencies [407feea]
    -   @nhost/graphql-js@0.1.8

## @nhost/react@3.2.3

### Patch Changes

-   @nhost/nhost-js@3.0.8

## @nhost/vue@2.2.3

### Patch Changes

-   @nhost/nhost-js@3.0.8

## @nhost/dashboard@1.8.3

### Patch Changes

-   @nhost/react-apollo@9.0.3
-   @nhost/nextjs@2.1.5

## @nhost-examples/cli@0.1.9

### Patch Changes

-   @nhost/nhost-js@3.0.8

## @nhost-examples/codegen-react-apollo@0.1.17

### Patch Changes

-   @nhost/react@3.2.3
-   @nhost/react-apollo@9.0.3

## @nhost-examples/codegen-react-query@0.1.18

### Patch Changes

-   @nhost/react@3.2.3

## @nhost-examples/codegen-react-urql@0.0.14

### Patch Changes

-   @nhost/react@3.2.3
-   @nhost/react-urql@6.0.3

## @nhost-examples/multi-tenant-one-to-many@2.0.7

### Patch Changes

-   @nhost/nhost-js@3.0.8

## @nhost-examples/nextjs@0.1.19

### Patch Changes

-   @nhost/react@3.2.3
-   @nhost/react-apollo@9.0.3
-   @nhost/nextjs@2.1.5

## @nhost-examples/node-storage@0.0.11

### Patch Changes

-   @nhost/nhost-js@3.0.8

## @nhost-examples/nextjs-server-components@0.2.5

### Patch Changes

-   @nhost/nhost-js@3.0.8

## @nhost-examples/react-apollo@0.3.3

### Patch Changes

-   @nhost/react@3.2.3
-   @nhost/react-apollo@9.0.3

## @nhost-examples/react-gqty@1.0.7

### Patch Changes

-   @nhost/react@3.2.3

## @nhost-examples/vue-apollo@0.2.4

### Patch Changes

-   @nhost/nhost-js@3.0.8
-   @nhost/apollo@6.0.8
-   @nhost/vue@2.2.3

## @nhost-examples/vue-quickstart@0.0.16

### Patch Changes

-   @nhost/apollo@6.0.8
-   @nhost/vue@2.2.3

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-29 15:43:48 +01:00
Hassan Ben Jobrane
407feeac37 fix: sdk: graphql-js: replace jwt-decode with jose to decode access tokens in both node and the browser (#2570) 2024-02-29 14:51:33 +01:00
44 changed files with 177 additions and 29 deletions

View File

@@ -1,5 +1,12 @@
# @nhost/dashboard
## 1.8.3
### Patch Changes
- @nhost/react-apollo@9.0.3
- @nhost/nextjs@2.1.5
## 1.8.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "1.8.2",
"version": "1.8.3",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",

View File

@@ -1,5 +1,11 @@
# @nhost-examples/cli
## 0.1.9
### Patch Changes
- @nhost/nhost-js@3.0.8
## 0.1.8
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/cli",
"version": "0.1.8",
"version": "0.1.9",
"main": "src/index.mjs",
"private": true,
"scripts": {

View File

@@ -1,5 +1,12 @@
# @nhost-examples/codegen-react-apollo
## 0.1.17
### Patch Changes
- @nhost/react@3.2.3
- @nhost/react-apollo@9.0.3
## 0.1.16
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/codegen-react-apollo",
"version": "0.1.16",
"version": "0.1.17",
"private": true,
"scripts": {
"codegen": "graphql-codegen",

View File

@@ -1,5 +1,11 @@
# @nhost-examples/codegen-react-query
## 0.1.18
### Patch Changes
- @nhost/react@3.2.3
## 0.1.17
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/codegen-react-query",
"version": "0.1.17",
"version": "0.1.18",
"private": true,
"scripts": {
"codegen": "graphql-codegen",

View File

@@ -1,5 +1,12 @@
# @nhost-examples/react-urql
## 0.0.14
### Patch Changes
- @nhost/react@3.2.3
- @nhost/react-urql@6.0.3
## 0.0.13
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@nhost-examples/codegen-react-urql",
"private": true,
"version": "0.0.13",
"version": "0.0.14",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",

View File

@@ -1,5 +1,11 @@
# @nhost-examples/multi-tenant-one-to-many
## 2.0.7
### Patch Changes
- @nhost/nhost-js@3.0.8
## 2.0.6
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@nhost-examples/multi-tenant-one-to-many",
"private": true,
"version": "2.0.6",
"version": "2.0.7",
"description": "",
"main": "index.js",
"scripts": {},

View File

@@ -1,5 +1,13 @@
# @nhost-examples/nextjs
## 0.1.19
### Patch Changes
- @nhost/react@3.2.3
- @nhost/react-apollo@9.0.3
- @nhost/nextjs@2.1.5
## 0.1.18
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/nextjs",
"version": "0.1.18",
"version": "0.1.19",
"private": true,
"scripts": {
"dev": "next dev",

View File

@@ -1,5 +1,11 @@
# @nhost-examples/node-storage
## 0.0.11
### Patch Changes
- @nhost/nhost-js@3.0.8
## 0.0.10
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/node-storage",
"version": "0.0.10",
"version": "0.0.11",
"private": true,
"description": "This is an example of how to use the Storage with Node.js",
"main": "src/index.mjs",

View File

@@ -1,5 +1,11 @@
# @nhost-examples/nextjs-server-components
## 0.2.5
### Patch Changes
- @nhost/nhost-js@3.0.8
## 0.2.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/nextjs-server-components",
"version": "0.2.4",
"version": "0.2.5",
"private": true,
"scripts": {
"dev": "next dev",

View File

@@ -1,5 +1,12 @@
# @nhost-examples/react-apollo
## 0.3.3
### Patch Changes
- @nhost/react@3.2.3
- @nhost/react-apollo@9.0.3
## 0.3.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/react-apollo",
"version": "0.3.2",
"version": "0.3.3",
"private": true,
"dependencies": {
"@apollo/client": "^3.9.4",

View File

@@ -1,5 +1,11 @@
# @nhost-examples/react-gqty
## 1.0.7
### Patch Changes
- @nhost/react@3.2.3
## 1.0.6
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@nhost-examples/react-gqty",
"private": true,
"version": "1.0.6",
"version": "1.0.7",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,13 @@
# @nhost-examples/vue-apollo
## 0.2.4
### Patch Changes
- @nhost/nhost-js@3.0.8
- @nhost/apollo@6.0.8
- @nhost/vue@2.2.3
## 0.2.3
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@nhost-examples/vue-apollo",
"private": true,
"version": "0.2.3",
"version": "0.2.4",
"scripts": {
"dev": "vite",
"build": "vite build",

View File

@@ -1,5 +1,12 @@
# @nhost-examples/vue-quickstart
## 0.0.16
### Patch Changes
- @nhost/apollo@6.0.8
- @nhost/vue@2.2.3
## 0.0.15
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/vue-quickstart",
"version": "0.0.15",
"version": "0.0.16",
"private": true,
"scripts": {
"build": "vite build",

View File

@@ -1,5 +1,11 @@
# @nhost/apollo
## 6.0.8
### Patch Changes
- @nhost/nhost-js@3.0.8
## 6.0.7
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/apollo",
"version": "6.0.7",
"version": "6.0.8",
"description": "Nhost Apollo Client library",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,12 @@
# @nhost/react-apollo
## 9.0.3
### Patch Changes
- @nhost/apollo@6.0.8
- @nhost/react@3.2.3
## 9.0.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-apollo",
"version": "9.0.2",
"version": "9.0.3",
"description": "Nhost React Apollo client",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/react-urql
## 6.0.3
### Patch Changes
- @nhost/react@3.2.3
## 6.0.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-urql",
"version": "6.0.2",
"version": "6.0.3",
"description": "Nhost React URQL client",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/graphql-js
## 0.1.8
### Patch Changes
- 407feea: fix: replace `jwt-decode` with `jose` to decode access tokens in a non browser environment
## 0.1.7
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/graphql-js",
"version": "0.1.7",
"version": "0.1.8",
"description": "Nhost GraphQL client",
"license": "MIT",
"keywords": [
@@ -55,7 +55,7 @@
"dependencies": {
"@graphql-typed-document-node/core": "^3.2.0",
"isomorphic-unfetch": "^3.1.0",
"jwt-decode": "^3.1.2"
"jose": "^5.2.2"
},
"peerDependencies": {
"graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"

View File

@@ -12,7 +12,7 @@ import {
Variables
} from './types'
import jwtDecode, { JwtPayload } from 'jwt-decode'
import * as jose from 'jose'
/**
* @alias GraphQL
@@ -36,7 +36,7 @@ export class NhostGraphqlClient {
}
try {
const decodedToken: JwtPayload = jwtDecode(this.accessToken)
const decodedToken = jose.decodeJwt<jose.JWTPayload>(this.accessToken)
return decodedToken.exp != null && decodedToken.exp * 1000 > Date.now()
} catch (error) {
console.error('Error decoding token:', error)

View File

@@ -1,5 +1,11 @@
# @nhost/nextjs
## 2.1.5
### Patch Changes
- @nhost/react@3.2.3
## 2.1.4
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nextjs",
"version": "2.1.4",
"version": "2.1.5",
"description": "Nhost NextJS library",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,12 @@
# @nhost/nhost-js
## 3.0.8
### Patch Changes
- Updated dependencies [407feea]
- @nhost/graphql-js@0.1.8
## 3.0.7
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/nhost-js",
"version": "3.0.7",
"version": "3.0.8",
"description": "Nhost JavaScript SDK",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/react
## 3.2.3
### Patch Changes
- @nhost/nhost-js@3.0.8
## 3.2.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react",
"version": "3.2.2",
"version": "3.2.3",
"description": "Nhost React library",
"license": "MIT",
"keywords": [

View File

@@ -1,5 +1,11 @@
# @nhost/vue
## 2.2.3
### Patch Changes
- @nhost/nhost-js@3.0.8
## 2.2.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/vue",
"version": "2.2.2",
"version": "2.2.3",
"description": "Nhost Vue library",
"license": "MIT",
"keywords": [

21
pnpm-lock.yaml generated
View File

@@ -1578,9 +1578,9 @@ importers:
isomorphic-unfetch:
specifier: ^3.1.0
version: 3.1.0
jwt-decode:
specifier: ^3.1.2
version: 3.1.2
jose:
specifier: ^5.2.2
version: 5.2.2
devDependencies:
'@nhost/docgen':
specifier: workspace:*
@@ -5982,7 +5982,7 @@ packages:
/@graphql-typed-document-node/core@3.2.0(graphql@16.8.1):
resolution: {integrity: sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==}
peerDependencies:
graphql: 16.8.1
graphql: '>=16.8.1'
dependencies:
graphql: 16.8.1
@@ -19205,7 +19205,7 @@ packages:
/isomorphic-unfetch@3.1.0:
resolution: {integrity: sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q==}
dependencies:
node-fetch: 2.7.0(encoding@0.1.13)
node-fetch: 2.7.0
unfetch: 4.2.0
transitivePeerDependencies:
- encoding
@@ -22003,6 +22003,17 @@ packages:
dependencies:
whatwg-url: 5.0.0
/node-fetch@2.7.0:
resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
engines: {node: 4.x || >=6.0.0}
peerDependencies:
encoding: ^0.1.0
peerDependenciesMeta:
encoding:
optional: true
dependencies:
whatwg-url: 5.0.0
/node-fetch@2.7.0(encoding@0.1.13):
resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}
engines: {node: 4.x || >=6.0.0}