Compare commits

...

10 Commits

Author SHA1 Message Date
github-actions[bot]
3143d66a8e chore: update versions (#2701)
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@7.0.1

### Patch Changes

-   @nhost/nhost-js@3.1.1

## @nhost/react-apollo@11.0.3

### Patch Changes

-   @nhost/apollo@7.0.1
-   @nhost/react@3.4.3

## @nhost/react-urql@8.0.3

### Patch Changes

-   @nhost/react@3.4.3

## @nhost/hasura-storage-js@2.5.1

### Patch Changes

- 8512a7f: fix: fix types StorageGetUrlParams and
StorageGetPresignedUrlParams to include missing StorageHeadersParam

## @nhost/nextjs@2.1.12

### Patch Changes

-   @nhost/react@3.4.3

## @nhost/nhost-js@3.1.1

### Patch Changes

-   Updated dependencies [8512a7f]
    -   @nhost/hasura-storage-js@2.5.1

## @nhost/react@3.4.3

### Patch Changes

-   @nhost/nhost-js@3.1.1

## @nhost/vue@2.5.3

### Patch Changes

-   @nhost/nhost-js@3.1.1

## @nhost/dashboard@1.15.1

### Patch Changes

-   @nhost/react-apollo@11.0.3
-   @nhost/nextjs@2.1.12

## @nhost-examples/cli@0.3.3

### Patch Changes

-   @nhost/nhost-js@3.1.1

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

### Patch Changes

-   @nhost/react@3.4.3
-   @nhost/react-apollo@11.0.3

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

### Patch Changes

-   @nhost/react@3.4.3

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

### Patch Changes

-   @nhost/react@3.4.3
-   @nhost/react-urql@8.0.3

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

### Patch Changes

-   @nhost/nhost-js@3.1.1

## @nhost-examples/nextjs@0.3.3

### Patch Changes

-   @nhost/react@3.4.3
-   @nhost/react-apollo@11.0.3
-   @nhost/nextjs@2.1.12

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

### Patch Changes

-   @nhost/nhost-js@3.1.1

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

### Patch Changes

-   @nhost/nhost-js@3.1.1

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

### Patch Changes

-   @nhost/react@3.4.3
-   @nhost/react-apollo@11.0.3

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

### Patch Changes

-   @nhost/react@3.4.3

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

### Patch Changes

-   @nhost/nhost-js@3.1.1
-   @nhost/apollo@7.0.1
-   @nhost/vue@2.5.3

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

### Patch Changes

-   @nhost/apollo@7.0.1
-   @nhost/vue@2.5.3

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-13 21:58:21 +01:00
Hassan Ben Jobrane
8512a7f181 fix:(hasura-storage-js): add missing StorageHeadersParam to StorageGetUrlParams and StorageGetPresignedUrlParams (#2700) 2024-05-13 21:39:48 +01:00
github-actions[bot]
e503b8fe8b chore: update versions (#2691)
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/graphql-js@0.2.0

### Minor Changes

- 304065a: feat: add `setHeaders` method enabling global configuration
of storage, graphql, and functions client headers, alongside added
support for passing specific headers with individual calls

## @nhost/hasura-storage-js@2.5.0

### Minor Changes

- 304065a: feat: add `setHeaders` method enabling global configuration
of storage, graphql, and functions client headers, alongside added
support for passing specific headers with individual calls

## @nhost/nhost-js@3.1.0

### Minor Changes

- 304065a: feat: add `setHeaders` method enabling global configuration
of storage, graphql, and functions client headers, alongside added
support for passing specific headers with individual calls

### Patch Changes

-   Updated dependencies [68e0622]
-   Updated dependencies [304065a]
    -   @nhost/hasura-auth-js@2.4.2
    -   @nhost/hasura-storage-js@2.5.0
    -   @nhost/graphql-js@0.2.0

## @nhost/apollo@7.0.0

### Patch Changes

-   Updated dependencies [304065a]
    -   @nhost/nhost-js@3.1.0

## @nhost/react-apollo@11.0.2

### Patch Changes

-   @nhost/apollo@7.0.0
-   @nhost/react@3.4.2

## @nhost/react-urql@8.0.2

### Patch Changes

-   @nhost/react@3.4.2

## @nhost/hasura-auth-js@2.4.2

### Patch Changes

- 68e0622: fix: resolved infinite loop occurring with requests to /token
when a user logs out in one tab while other tabs are open

## @nhost/nextjs@2.1.11

### Patch Changes

-   @nhost/react@3.4.2

## @nhost/react@3.4.2

### Patch Changes

-   Updated dependencies [304065a]
    -   @nhost/nhost-js@3.1.0

## @nhost/vue@2.5.2

### Patch Changes

-   Updated dependencies [304065a]
    -   @nhost/nhost-js@3.1.0

## @nhost/dashboard@1.15.0

### Minor Changes

-   a7bde37: feat: send metadata in the edit form

### Patch Changes

- 1bc615b: feat: improve error message handling in `ErrorToast`
component
    -   @nhost/react-apollo@11.0.2
    -   @nhost/nextjs@2.1.11

## @nhost/docs@2.10.3

### Patch Changes

-   a58c5cf: fix: broken link

## @nhost-examples/cli@0.3.2

### Patch Changes

-   Updated dependencies [304065a]
    -   @nhost/nhost-js@3.1.0

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

### Patch Changes

-   @nhost/react@3.4.2
-   @nhost/react-apollo@11.0.2

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

### Patch Changes

-   @nhost/react@3.4.2

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

### Patch Changes

-   @nhost/react@3.4.2
-   @nhost/react-urql@8.0.2

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

### Patch Changes

-   Updated dependencies [304065a]
    -   @nhost/nhost-js@3.1.0

## @nhost-examples/nextjs@0.3.2

### Patch Changes

-   @nhost/react@3.4.2
-   @nhost/react-apollo@11.0.2
-   @nhost/nextjs@2.1.11

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

### Patch Changes

-   Updated dependencies [304065a]
    -   @nhost/nhost-js@3.1.0

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

### Patch Changes

-   Updated dependencies [304065a]
    -   @nhost/nhost-js@3.1.0

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

### Patch Changes

-   @nhost/react@3.4.2
-   @nhost/react-apollo@11.0.2

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

### Patch Changes

-   @nhost/react@3.4.2

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

### Patch Changes

-   Updated dependencies [304065a]
    -   @nhost/nhost-js@3.1.0
    -   @nhost/apollo@7.0.0
    -   @nhost/vue@2.5.2

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

### Patch Changes

-   @nhost/apollo@7.0.0
-   @nhost/vue@2.5.2

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-13 13:52:42 +01:00
Hassan Ben Jobrane
304065ae22 feat: sdk: add setHeaders for setting global headers and make sure all client calls have a headers arg (#2697)
resolves https://github.com/nhost/nhost/issues/2696
2024-05-13 13:38:28 +01:00
Hassan Ben Jobrane
68e0622eb0 fix: broadcast signout event to all tabs (#2686)
fixes https://github.com/nhost/nhost/issues/2635
2024-05-09 11:20:39 +01:00
Hassan Ben Jobrane
70c6834636 chore: add e2e test project (#2688) 2024-05-08 12:52:11 +01:00
Johanna Blom
a7bde37bba feat (dashboard): send metadata in the edit form (#2689)
resolves #2684

---------

Co-authored-by: Hassan Ben Jobrane <hsanbenjobrane@gmail.com>
2024-05-08 13:36:03 +02:00
Hassan Ben Jobrane
1bc615beca fix(dashboard): improve error toast message handling (#2692) 2024-05-08 12:35:21 +01:00
David Barroso
a58c5cfc96 fix (docs): broken link (#2690) 2024-05-08 12:42:58 +02:00
Daniel Olofsson
c61228e45d Fixed typo in README.md (#2687) 2024-05-07 14:39:31 +02:00
113 changed files with 1359 additions and 76 deletions

View File

@@ -1,5 +1,24 @@
# @nhost/dashboard
## 1.15.1
### Patch Changes
- @nhost/react-apollo@11.0.3
- @nhost/nextjs@2.1.12
## 1.15.0
### Minor Changes
- a7bde37: feat: send metadata in the edit form
### Patch Changes
- 1bc615b: feat: improve error message handling in `ErrorToast` component
- @nhost/react-apollo@11.0.2
- @nhost/nextjs@2.1.11
## 1.14.0
### Minor Changes

View File

@@ -0,0 +1,2 @@
.secrets
.nhost

View File

@@ -0,0 +1 @@
version: 3

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Потвърдете смяната на вашия имейл</h2>
<p>Използвайте посочения линк, за да повърдите смяната на имейл:</p>
<p>
<a href="${link}">
Смени имейл
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Потвърждение за смяна на имейл

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Потвърдете вашия имейл</h2>
<p>Използвайте посочения линк, за да потвърдите вашия имейл:</p>
<p>
<a href="${link}">
Потвърдете имейл
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Потвърждаване на имейл

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Смяна на парола</h2>
<p>Използвайте посочения линк, за да смените вашата парола:</p>
<p>
<a href="${link}">
Смяна на парола
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Смяна на парола

View File

@@ -0,0 +1 @@
Вашият код е ${code}.

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Магически линк за вход</h2>
<p>Използвайте посочения линк за защитен и бърз вход:</p>
<p>
<a href="${link}">
Вход
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Магически линк за вход

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Potvrzení změny emailové adresy</h2>
<p>Použijte tento odkaz k potvrzení změny emailové adresy:</p>
<p>
<a href="${link}">
Změnit email
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Změna vaší emailové adresy

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Ověření emailové adresy</h2>
<p>Použijte tento odkaz k ověření vaší emailové adresy:</p>
<p>
<a href="${link}">
Ověřit emailovou adresu
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Ověření vaší emailové adresy

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Obnova hesla</h2>
<p>Použijte tento odkaz k obnovení vašeho hesla:</p>
<p>
<a href="${link}">
Obnova hesla
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Obnova hesla

View File

@@ -0,0 +1 @@
Váš kód je ${code}.

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Magický odkaz</h2>
<p>Použijte tento odkaz k bezpečnému přihlášení:</p>
<p>
<a href="${link}">
Přihlášení
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Bezpečný odkaz k přihlášení

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Confirm Email Change</h2>
<p>Use this link to confirm changing email:</p>
<p>
<a href="${link}">
Change email
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Change your email address

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Verify Email</h2>
<p>Use this link to verify your email:</p>
<p>
<a href="${link}">
Verify Email
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Verify your email

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Reset Password</h2>
<p>Use this link to reset your password:</p>
<p>
<a href="${link}">
Reset password
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Reset your password

View File

@@ -0,0 +1 @@
Your code is ${code}.

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Magic Link</h2>
<p>Use this link to securely sign in:</p>
<p>
<a href="${link}">
Sign In
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Secure sign-in link

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Confirmar cambio de correo electrónico</h2>
<p>Utiliza el siguiente enlace para confirmar el cambio de correo:</p>
<p>
<a href="${link}">
Cambiar correo electrónico
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Cambiar dirección de correo electrónico

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Verificar correo electrónico</h2>
<p>Utilza el siguiente enlace para verificar tu correo:</p>
<p>
<a href="${link}">
Verificar correo electrónico
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Verifica tu correo electrónico

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Recuperar contraseña</h2>
<p>Utiliza el siguiente enlace para recuperar tu contraseña:</p>
<p>
<a href="${link}">
Recuperar contraseña
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Recuperar contraseña

View File

@@ -0,0 +1 @@
Tu código es ${code}.

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Enlace mágico</h2>
<p>Utiliza este enlace para iniciar sesión de forma segura:</p>
<p>
<a href="${link}">
Iniciar sesión
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Enlace de acceso seguro

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Confirmer changement de courriel</h2>
<p>Utilisez ce lien pour confirmer le changement de courriel :</p>
<p>
<a href="${link}">
Changer courriel
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Changez votre adresse courriel

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>V&eacute;rifiez votre courriel</h2>
<p>Utilisez ce lien pour v&eacute;rifier votre courriel :</p>
<p>
<a href="${link}">
V&eacute;rifier courriel
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Vérifier votre courriel

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>R&eacute;initialiser votre mot de passe</h2>
<p>Utilisez ce lien pour r&eacute;initialiser votre mot de passe :</p>
<p>
<a href="${link}">
R&eacute;initialiser mot de passe
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Réinitialiser votre mot de passe

View File

@@ -0,0 +1 @@
Votre code est ${code}.

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<h2>Lien magique</h2>
<p>Utilisez ce lien pour vous connecter de fa&ccedil;on s&eacute;curisée :</p>
<p>
<a href="${link}">
Connexion
</a>
</p>
</body>
</html>

View File

@@ -0,0 +1 @@
Lien de connexion sécurisé

View File

@@ -0,0 +1,8 @@
${link},
${displayName},
${email},
${ticket},
${redirectTo},
${serverUrl},
${clientUrl},
${locale},

View File

@@ -0,0 +1 @@
${link}, ${displayName}, ${email}, ${ticket}, ${redirectTo}, ${serverUrl}, ${clientUrl}, ${locale}

View File

@@ -0,0 +1,151 @@
[global]
[hasura]
version = 'v2.33.4-ce'
adminSecret = '{{ secrets.HASURA_GRAPHQL_ADMIN_SECRET }}'
webhookSecret = '{{ secrets.NHOST_WEBHOOK_SECRET }}'
[[hasura.jwtSecrets]]
type = 'HS256'
key = '{{ secrets.HASURA_GRAPHQL_JWT_SECRET }}'
[hasura.settings]
corsDomain = ['*']
devMode = true
enableAllowList = false
enableConsole = true
enableRemoteSchemaPermissions = false
enabledAPIs = ['metadata', 'graphql', 'pgdump', 'config']
liveQueriesMultiplexedRefetchInterval = 1000
stringifyNumericTypes = false
[hasura.logs]
level = 'warn'
[hasura.events]
httpPoolSize = 100
[functions]
[functions.node]
version = 18
[auth]
version = '0.24.1'
[auth.elevatedPrivileges]
mode = 'disabled'
[auth.redirections]
clientUrl = 'http://localhost:3000'
[auth.signUp]
enabled = true
disableNewUsers = false
[auth.user]
[auth.user.roles]
default = 'user'
allowed = ['user', 'me']
[auth.user.locale]
default = 'en'
allowed = ['en']
[auth.user.gravatar]
enabled = true
default = 'blank'
rating = 'g'
[auth.user.email]
[auth.user.emailDomains]
[auth.session]
[auth.session.accessToken]
expiresIn = 900
[auth.session.refreshToken]
expiresIn = 2592000
[auth.method]
[auth.method.anonymous]
enabled = false
[auth.method.emailPasswordless]
enabled = false
[auth.method.emailPassword]
hibpEnabled = false
emailVerificationRequired = true
passwordMinLength = 9
[auth.method.smsPasswordless]
enabled = false
[auth.method.oauth]
[auth.method.oauth.apple]
enabled = false
[auth.method.oauth.azuread]
tenant = 'common'
enabled = false
[auth.method.oauth.bitbucket]
enabled = false
[auth.method.oauth.discord]
enabled = false
[auth.method.oauth.facebook]
enabled = false
[auth.method.oauth.github]
enabled = false
[auth.method.oauth.gitlab]
enabled = false
[auth.method.oauth.google]
enabled = false
[auth.method.oauth.linkedin]
enabled = false
[auth.method.oauth.spotify]
enabled = false
[auth.method.oauth.strava]
enabled = false
[auth.method.oauth.twitch]
enabled = false
[auth.method.oauth.twitter]
enabled = false
[auth.method.oauth.windowslive]
enabled = false
[auth.method.oauth.workos]
enabled = false
[auth.method.webauthn]
enabled = false
[auth.method.webauthn.attestation]
timeout = 60000
[auth.totp]
enabled = false
[postgres]
version = '14.6-20240129-1'
[provider]
[storage]
version = '0.6.0'
[observability]
[observability.grafana]
adminPassword = '{{ secrets.GRAFANA_ADMIN_PASSWORD }}'

View File

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

View File

@@ -29,10 +29,10 @@ const getInternalErrorMessage = (
if (error.name === 'ApolloError') {
// @ts-ignore
const internalError = error.graphQLErrors?.[0]?.extensions?.internal as {
error: { message: string };
};
return internalError?.error?.message || null;
const graphqlError = error.graphQLErrors?.[0];
const graphqlExtensionsError = graphqlError?.extensions?.internal
?.error as { message: string };
return graphqlError.message || graphqlExtensionsError?.message || null;
}
if (error instanceof Error) {

View File

@@ -31,9 +31,10 @@ import { yupResolver } from '@hookform/resolvers/yup';
import { useTheme } from '@mui/material';
import { format } from 'date-fns';
import kebabCase from 'just-kebab-case';
import debounce from 'lodash.debounce';
import Image from 'next/image';
import type { RemoteAppUser } from 'pages/[workspaceSlug]/[appSlug]/users';
import { useEffect, useState } from 'react';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
import * as Yup from 'yup';
@@ -76,6 +77,21 @@ export const EditUserFormValidationSchema = Yup.object({
locale: Yup.string(),
defaultRole: Yup.string(),
roles: Yup.array().of(Yup.boolean()),
metadata: Yup.string().test(
'is-valid-json',
'Metadata must be valid JSON or empty',
(value) => {
if (value === '') {
return true;
} // Allow empty string as valid input
try {
JSON.parse(value);
return true;
} catch (error) {
return false;
}
},
),
});
export type EditUserFormValues = Yup.InferType<
@@ -116,14 +132,55 @@ export default function EditUserForm({
locale: user.locale,
defaultRole: user.defaultRole,
roles: roles.map((role) => Object.values(role)[0]),
metadata: user?.metadata ? JSON.stringify(user.metadata, null, 2) : '',
},
});
const {
register,
setError,
clearErrors,
formState: { errors, dirtyFields, isSubmitting, isValidating },
} = form;
const handleMetadataError = useMemo(() => {
const debouncedSetError = debounce((value) => {
try {
JSON.parse(value);
// Only set an error if JSON parsing fails
} catch (error) {
setError('metadata', {
type: 'manual',
message: 'Invalid JSON format',
});
}
}, 500);
return {
call: debouncedSetError,
cancel: debouncedSetError.cancel, // lodash debounce provides a cancel method to stop the delayed function
};
}, [setError]);
const handleMetadataChange = useCallback(
(event: React.ChangeEvent<HTMLInputElement>) => {
const { value } = event.target;
if (value === '') {
clearErrors('metadata'); // Clear errors when the input is explicitly cleared
handleMetadataError.cancel(); // Cancel any debounced error checks
} else {
try {
JSON.parse(value);
clearErrors('metadata'); // Clear errors when valid JSON is entered
handleMetadataError.cancel(); // Cancel pending debounced error checks
} catch (error) {
handleMetadataError.call(value); // Call the debounced error setter
}
}
},
[clearErrors, handleMetadataError],
);
const isDirty = Object.keys(dirtyFields).length > 0;
useEffect(() => {
@@ -467,6 +524,28 @@ export default function EditUserForm({
</div>
</Box>
)}
<Box component="section" className="grid grid-flow-row gap-8 p-6">
<Input
{...register('metadata', { onChange: handleMetadataChange })}
id="metadata"
label="Metadata"
variant="inline"
hideEmptyHelperText
error={!!errors.metadata}
fullWidth
multiline
inputProps={{
className: 'resize-y min-h-[130px]',
}}
helperText={
errors.metadata
? errors.metadata.message
: 'Enter valid JSON. This can be a number, boolean, array, or object.'
}
maxRows={100}
autoComplete="off"
/>
</Box>
</Box>
<Box className="grid w-full flex-shrink-0 snap-end grid-flow-col justify-between gap-3 place-self-end border-t-1 p-2">

View File

@@ -113,6 +113,9 @@ export default function UsersBody({ users, onSubmit }: UsersBodyProps) {
phoneNumber: values.phoneNumber,
phoneNumberVerified: values.phoneNumberVerified,
locale: values.locale,
...(values?.metadata !== undefined && values.metadata !== ''
? { metadata: JSON.parse(values.metadata) }
: { metadata: null }),
},
},
});

View File

@@ -11,6 +11,7 @@ fragment RemoteAppGetUsers on users {
defaultRole
lastSeen
locale
metadata
roles {
id
role

View File

@@ -2524,6 +2524,7 @@ export type ConfigSystemConfigPostgres = {
__typename?: 'ConfigSystemConfigPostgres';
connectionString: ConfigSystemConfigPostgresConnectionString;
database: Scalars['String'];
disk?: Maybe<ConfigSystemConfigPostgresDisk>;
enabled?: Maybe<Scalars['Boolean']>;
};
@@ -2533,6 +2534,7 @@ export type ConfigSystemConfigPostgresComparisonExp = {
_or?: InputMaybe<Array<ConfigSystemConfigPostgresComparisonExp>>;
connectionString?: InputMaybe<ConfigSystemConfigPostgresConnectionStringComparisonExp>;
database?: InputMaybe<ConfigStringComparisonExp>;
disk?: InputMaybe<ConfigSystemConfigPostgresDiskComparisonExp>;
enabled?: InputMaybe<ConfigBooleanComparisonExp>;
};
@@ -2568,15 +2570,41 @@ export type ConfigSystemConfigPostgresConnectionStringUpdateInput = {
storage?: InputMaybe<Scalars['String']>;
};
export type ConfigSystemConfigPostgresDisk = {
__typename?: 'ConfigSystemConfigPostgresDisk';
iops?: Maybe<Scalars['ConfigUint32']>;
tput?: Maybe<Scalars['ConfigUint32']>;
};
export type ConfigSystemConfigPostgresDiskComparisonExp = {
_and?: InputMaybe<Array<ConfigSystemConfigPostgresDiskComparisonExp>>;
_not?: InputMaybe<ConfigSystemConfigPostgresDiskComparisonExp>;
_or?: InputMaybe<Array<ConfigSystemConfigPostgresDiskComparisonExp>>;
iops?: InputMaybe<ConfigUint32ComparisonExp>;
tput?: InputMaybe<ConfigUint32ComparisonExp>;
};
export type ConfigSystemConfigPostgresDiskInsertInput = {
iops?: InputMaybe<Scalars['ConfigUint32']>;
tput?: InputMaybe<Scalars['ConfigUint32']>;
};
export type ConfigSystemConfigPostgresDiskUpdateInput = {
iops?: InputMaybe<Scalars['ConfigUint32']>;
tput?: InputMaybe<Scalars['ConfigUint32']>;
};
export type ConfigSystemConfigPostgresInsertInput = {
connectionString: ConfigSystemConfigPostgresConnectionStringInsertInput;
database: Scalars['String'];
disk?: InputMaybe<ConfigSystemConfigPostgresDiskInsertInput>;
enabled?: InputMaybe<Scalars['Boolean']>;
};
export type ConfigSystemConfigPostgresUpdateInput = {
connectionString?: InputMaybe<ConfigSystemConfigPostgresConnectionStringUpdateInput>;
database?: InputMaybe<Scalars['String']>;
disk?: InputMaybe<ConfigSystemConfigPostgresDiskUpdateInput>;
enabled?: InputMaybe<Scalars['Boolean']>;
};
@@ -23098,7 +23126,7 @@ export type GetRemoteAppMetricsQueryVariables = Exact<{ [key: string]: never; }>
export type GetRemoteAppMetricsQuery = { __typename?: 'query_root', filesAggregate: { __typename?: 'files_aggregate', aggregate?: { __typename?: 'files_aggregate_fields', count: number, sum?: { __typename?: 'files_sum_fields', size?: number | null } | null } | null }, usersAggregate: { __typename?: 'users_aggregate', aggregate?: { __typename?: 'users_aggregate_fields', count: number } | null } };
export type RemoteAppGetUsersFragment = { __typename?: 'users', id: any, createdAt: any, displayName: string, avatarUrl: string, email?: any | null, emailVerified: boolean, phoneNumber?: string | null, phoneNumberVerified: boolean, disabled: boolean, defaultRole: string, lastSeen?: any | null, locale: string, roles: Array<{ __typename?: 'authUserRoles', id: any, role: string }>, userProviders: Array<{ __typename?: 'authUserProviders', id: any, providerId: string }> };
export type RemoteAppGetUsersFragment = { __typename?: 'users', id: any, createdAt: any, displayName: string, avatarUrl: string, email?: any | null, emailVerified: boolean, phoneNumber?: string | null, phoneNumberVerified: boolean, disabled: boolean, defaultRole: string, lastSeen?: any | null, locale: string, metadata?: any | null, roles: Array<{ __typename?: 'authUserRoles', id: any, role: string }>, userProviders: Array<{ __typename?: 'authUserProviders', id: any, providerId: string }> };
export type RemoteAppGetUsersQueryVariables = Exact<{
where: Users_Bool_Exp;
@@ -23107,7 +23135,7 @@ export type RemoteAppGetUsersQueryVariables = Exact<{
}>;
export type RemoteAppGetUsersQuery = { __typename?: 'query_root', users: Array<{ __typename?: 'users', id: any, createdAt: any, displayName: string, avatarUrl: string, email?: any | null, emailVerified: boolean, phoneNumber?: string | null, phoneNumberVerified: boolean, disabled: boolean, defaultRole: string, lastSeen?: any | null, locale: string, roles: Array<{ __typename?: 'authUserRoles', id: any, role: string }>, userProviders: Array<{ __typename?: 'authUserProviders', id: any, providerId: string }> }>, filteredUsersAggreggate: { __typename?: 'users_aggregate', aggregate?: { __typename?: 'users_aggregate_fields', count: number } | null }, usersAggregate: { __typename?: 'users_aggregate', aggregate?: { __typename?: 'users_aggregate_fields', count: number } | null } };
export type RemoteAppGetUsersQuery = { __typename?: 'query_root', users: Array<{ __typename?: 'users', id: any, createdAt: any, displayName: string, avatarUrl: string, email?: any | null, emailVerified: boolean, phoneNumber?: string | null, phoneNumberVerified: boolean, disabled: boolean, defaultRole: string, lastSeen?: any | null, locale: string, metadata?: any | null, roles: Array<{ __typename?: 'authUserRoles', id: any, role: string }>, userProviders: Array<{ __typename?: 'authUserProviders', id: any, providerId: string }> }>, filteredUsersAggreggate: { __typename?: 'users_aggregate', aggregate?: { __typename?: 'users_aggregate_fields', count: number } | null }, usersAggregate: { __typename?: 'users_aggregate', aggregate?: { __typename?: 'users_aggregate_fields', count: number } | null } };
export type RemoteAppGetUsersCustomQueryVariables = Exact<{
where: Users_Bool_Exp;
@@ -23124,7 +23152,7 @@ export type RemoteAppGetUsersWholeQueryVariables = Exact<{
}>;
export type RemoteAppGetUsersWholeQuery = { __typename?: 'query_root', users: Array<{ __typename?: 'users', id: any, createdAt: any, displayName: string, avatarUrl: string, email?: any | null, emailVerified: boolean, phoneNumber?: string | null, phoneNumberVerified: boolean, disabled: boolean, defaultRole: string, lastSeen?: any | null, locale: string, roles: Array<{ __typename?: 'authUserRoles', id: any, role: string }>, userProviders: Array<{ __typename?: 'authUserProviders', id: any, providerId: string }> }>, usersAggregate: { __typename?: 'users_aggregate', aggregate?: { __typename?: 'users_aggregate_fields', count: number } | null } };
export type RemoteAppGetUsersWholeQuery = { __typename?: 'query_root', users: Array<{ __typename?: 'users', id: any, createdAt: any, displayName: string, avatarUrl: string, email?: any | null, emailVerified: boolean, phoneNumber?: string | null, phoneNumberVerified: boolean, disabled: boolean, defaultRole: string, lastSeen?: any | null, locale: string, metadata?: any | null, roles: Array<{ __typename?: 'authUserRoles', id: any, role: string }>, userProviders: Array<{ __typename?: 'authUserProviders', id: any, providerId: string }> }>, usersAggregate: { __typename?: 'users_aggregate', aggregate?: { __typename?: 'users_aggregate_fields', count: number } | null } };
export type TotalUsersQueryVariables = Exact<{ [key: string]: never; }>;
@@ -23623,6 +23651,7 @@ export const RemoteAppGetUsersFragmentDoc = gql`
defaultRole
lastSeen
locale
metadata
roles {
id
role

View File

@@ -1,5 +1,11 @@
# @nhost/docs
## 2.10.3
### Patch Changes
- a58c5cf: fix: broken link
## 2.10.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/docs",
"version": "2.10.2",
"version": "2.10.3",
"private": true,
"scripts": {
"start": "mintlify dev"

View File

@@ -50,7 +50,7 @@ In addition, thanks to [pgvector](https://github.com/pgvector/pgvector) you can
<CardGroup cols={4}>
<Card title="Enabling Service" icon="square-1" href="../guides/ai/enabling-service">
</Card>
<Card title="Local Development" icon="square-2" href="../guides/ai/local_development">
<Card title="Local Development" icon="square-2" href="../guides/ai/local-development">
</Card>
<Card title="Auto-Embeddings" icon="square-3" href="../guides/ai/auto-embeddings">
</Card>

View File

@@ -1,5 +1,18 @@
# @nhost-examples/cli
## 0.3.3
### Patch Changes
- @nhost/nhost-js@3.1.1
## 0.3.2
### Patch Changes
- Updated dependencies [304065a]
- @nhost/nhost-js@3.1.0
## 0.3.1
### Patch Changes

View File

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

View File

@@ -1,5 +1,19 @@
# @nhost-examples/codegen-react-apollo
## 0.4.3
### Patch Changes
- @nhost/react@3.4.3
- @nhost/react-apollo@11.0.3
## 0.4.2
### Patch Changes
- @nhost/react@3.4.2
- @nhost/react-apollo@11.0.2
## 0.4.1
### Patch Changes

View File

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

View File

@@ -1,5 +1,17 @@
# @nhost-examples/codegen-react-query
## 0.4.3
### Patch Changes
- @nhost/react@3.4.3
## 0.4.2
### Patch Changes
- @nhost/react@3.4.2
## 0.4.1
### Patch Changes

View File

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

View File

@@ -1,5 +1,19 @@
# @nhost-examples/react-urql
## 0.3.3
### Patch Changes
- @nhost/react@3.4.3
- @nhost/react-urql@8.0.3
## 0.3.2
### Patch Changes
- @nhost/react@3.4.2
- @nhost/react-urql@8.0.2
## 0.3.1
### Patch Changes

View File

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

View File

@@ -23,7 +23,7 @@ The following endpoints are now exposed:
- `http://localhost:3030`: Nhost Dashboard
- `http://localhost:1337`: Hasura Console
- `http://localhost:8025`: Mailhog SMTP testing dashboard
- `http://localhost:9090`: Traefik dashboad
- `http://localhost:9090`: Traefik dashboard
## Running the Nhost dashboard locally

View File

@@ -1,5 +1,18 @@
# @nhost-examples/multi-tenant-one-to-many
## 2.2.3
### Patch Changes
- @nhost/nhost-js@3.1.1
## 2.2.2
### Patch Changes
- Updated dependencies [304065a]
- @nhost/nhost-js@3.1.0
## 2.2.1
### Patch Changes

View File

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

View File

@@ -1,5 +1,21 @@
# @nhost-examples/nextjs
## 0.3.3
### Patch Changes
- @nhost/react@3.4.3
- @nhost/react-apollo@11.0.3
- @nhost/nextjs@2.1.12
## 0.3.2
### Patch Changes
- @nhost/react@3.4.2
- @nhost/react-apollo@11.0.2
- @nhost/nextjs@2.1.11
## 0.3.1
### Patch Changes

View File

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

View File

@@ -1,5 +1,18 @@
# @nhost-examples/node-storage
## 0.2.3
### Patch Changes
- @nhost/nhost-js@3.1.1
## 0.2.2
### Patch Changes
- Updated dependencies [304065a]
- @nhost/nhost-js@3.1.0
## 0.2.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/node-storage",
"version": "0.2.1",
"version": "0.2.3",
"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,18 @@
# @nhost-examples/nextjs-server-components
## 0.4.3
### Patch Changes
- @nhost/nhost-js@3.1.1
## 0.4.2
### Patch Changes
- Updated dependencies [304065a]
- @nhost/nhost-js@3.1.0
## 0.4.1
### Patch Changes

View File

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

View File

@@ -1,5 +1,19 @@
# @nhost-examples/react-apollo
## 0.8.3
### Patch Changes
- @nhost/react@3.4.3
- @nhost/react-apollo@11.0.3
## 0.8.2
### Patch Changes
- @nhost/react@3.4.2
- @nhost/react-apollo@11.0.2
## 0.8.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/react-apollo",
"version": "0.8.1",
"version": "0.8.3",
"private": true,
"dependencies": {
"@apollo/client": "^3.9.9",

View File

@@ -1,5 +1,17 @@
# @nhost-examples/react-gqty
## 1.2.3
### Patch Changes
- @nhost/react@3.4.3
## 1.2.2
### Patch Changes
- @nhost/react@3.4.2
## 1.2.1
### Patch Changes

View File

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

View File

@@ -1,5 +1,22 @@
# @nhost-examples/vue-apollo
## 0.6.3
### Patch Changes
- @nhost/nhost-js@3.1.1
- @nhost/apollo@7.0.1
- @nhost/vue@2.5.3
## 0.6.2
### Patch Changes
- Updated dependencies [304065a]
- @nhost/nhost-js@3.1.0
- @nhost/apollo@7.0.0
- @nhost/vue@2.5.2
## 0.6.1
### Patch Changes

View File

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

View File

@@ -1,5 +1,19 @@
# @nhost-examples/vue-quickstart
## 0.2.3
### Patch Changes
- @nhost/apollo@7.0.1
- @nhost/vue@2.5.3
## 0.2.2
### Patch Changes
- @nhost/apollo@7.0.0
- @nhost/vue@2.5.2
## 0.2.1
### Patch Changes

View File

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

View File

@@ -1,5 +1,18 @@
# @nhost/apollo
## 7.0.1
### Patch Changes
- @nhost/nhost-js@3.1.1
## 7.0.0
### Patch Changes
- Updated dependencies [304065a]
- @nhost/nhost-js@3.1.0
## 6.2.1
### Patch Changes

View File

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

View File

@@ -1,5 +1,19 @@
# @nhost/react-apollo
## 11.0.3
### Patch Changes
- @nhost/apollo@7.0.1
- @nhost/react@3.4.3
## 11.0.2
### Patch Changes
- @nhost/apollo@7.0.0
- @nhost/react@3.4.2
## 11.0.1
### Patch Changes

View File

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

View File

@@ -1,5 +1,17 @@
# @nhost/react-urql
## 8.0.3
### Patch Changes
- @nhost/react@3.4.3
## 8.0.2
### Patch Changes
- @nhost/react@3.4.2
## 8.0.1
### Patch Changes

View File

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

View File

@@ -1,5 +1,11 @@
# @nhost/graphql-js
## 0.2.0
### Minor Changes
- 304065a: feat: add `setHeaders` method enabling global configuration of storage, graphql, and functions client headers, alongside added support for passing specific headers with individual calls
## 0.1.9
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/graphql-js",
"version": "0.1.9",
"version": "0.2.0",
"description": "Nhost GraphQL client",
"license": "MIT",
"keywords": [

View File

@@ -21,6 +21,7 @@ export class NhostGraphqlClient {
readonly _url: string
private accessToken: string | null
private adminSecret?: string
private headers: Record<string, string> = {}
constructor(params: NhostGraphqlConstructorParams) {
const { url, adminSecret } = params
@@ -101,7 +102,7 @@ export class NhostGraphqlClient {
const [variables, config] = variablesAndRequestHeaders
const requestOptions = parseRequestArgs(documentOrOptions, variables, config)
const { headers, ...otherOptions } = config || {}
const { headers: extraHeaders, ...otherOptions } = config || {}
const { query, operationName } = resolveRequestDocument(requestOptions.document)
if (typeof process !== 'undefined' && !process.env.TEST_MODE) {
@@ -120,7 +121,8 @@ export class NhostGraphqlClient {
headers: {
'Content-Type': 'application/json',
...this.generateAccessTokenHeaders(),
...headers
...this.headers, // graphql client headers to be sent with all `request` calls
...extraHeaders // extra headers to be sent with a specific call
},
...otherOptions
})
@@ -228,6 +230,61 @@ export class NhostGraphqlClient {
this.accessToken = accessToken
}
/**
* Use `nhost.graphql.getHeaders` to get the global headers sent with all graphql requests
*
* @example
* ```ts
* nhost.graphql.getHeaders()
* ```
*
* @docs https://docs.nhost.io/reference/javascript/graphql/get-headers
*/
getHeaders(): Record<string, string> {
return this.headers
}
/**
* Use `nhost.graphql.setHeaders` to set global headers to be sent in all subsequent graphql requests
*
* @example
* ```ts
* nhost.graphql.setHeaders({
* 'x-hasura-role': 'admin'
* })
* ```
*
* @docs https://docs.nhost.io/reference/javascript/graphql/set-headers
*/
setHeaders(headers?: Record<string, string>) {
if (!headers) {
return
}
this.headers = {
...this.headers,
...headers
}
}
/**
* Use `nhost.graphql.unsetHeaders` to remove global headers sent with all requests, except for the role header to preserve
* the role set by 'setRole' method.
*
* @example
* ```ts
* nhost.graphql.unsetHeaders()
* ```
*
* @docs https://docs.nhost.io/reference/javascript/graphql/unset-headers
*/
unsetHeaders() {
const userRole = this.headers['x-hasura-role']
// preserve the user role header to avoid invalidating preceding 'setRole' call.
this.headers = userRole ? { 'x-hasura-role': userRole } : {}
}
private generateAccessTokenHeaders(): NhostGraphqlRequestConfig['headers'] {
if (this.adminSecret) {
return {

View File

@@ -1,5 +1,11 @@
# @nhost/hasura-auth-js
## 2.4.2
### Patch Changes
- 68e0622: fix: resolved infinite loop occurring with requests to /token when a user logs out in one tab while other tabs are open
## 2.4.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/hasura-auth-js",
"version": "2.4.1",
"version": "2.4.2",
"description": "Hasura-auth client",
"license": "MIT",
"keywords": [

View File

@@ -48,16 +48,32 @@ export class AuthClient {
this.start({ devTools })
}
if (typeof window !== 'undefined' && autoSignIn) {
if (typeof window !== 'undefined') {
try {
// TODO listen to sign out
// TODO the same refresh token is used and refreshed by all tabs
// * Ideally, a single tab should autorefresh and share the new jwt
this._channel = new BroadcastChannel('nhost')
this._channel.addEventListener('message', (token) => {
const existingToken = this.interpreter?.getSnapshot().context.refreshToken.value
if (this.interpreter && token.data !== existingToken) {
this.interpreter.send('TRY_TOKEN', { token: token.data })
if (autoSignIn) {
this._channel?.addEventListener('message', (event) => {
const { type, payload } = event.data
if (type === 'broadcast_token') {
const existingToken = this.interpreter?.getSnapshot().context.refreshToken.value
if (this.interpreter && payload.token.data !== existingToken) {
this.interpreter.send('TRY_TOKEN', { token: payload.token.data })
}
}
})
}
this._channel.addEventListener('message', (event) => {
const { type } = event.data
if (type === 'signout') {
if (this.interpreter) {
this.interpreter.send('SIGNOUT')
}
}
})
} catch (error) {

View File

@@ -670,7 +670,12 @@ export const createAuthMachine = ({
try {
const channel = new BroadcastChannel('nhost')
// ? broadcat session instead of token ?
channel.postMessage(context.refreshToken.value)
channel.postMessage({
type: 'broadcast_token',
payload: {
token: context.refreshToken.value
}
})
} catch (error) {
// * BroadcastChannel is not available e.g. react-native
}
@@ -866,11 +871,22 @@ export const createAuthMachine = ({
})
return { session, error: null }
},
signout: (ctx, e) =>
postRequest('/signout', {
signout: async (ctx, e) => {
const signOutResponse = await postRequest('/signout', {
refreshToken: ctx.refreshToken.value,
all: !!e.all
}),
})
try {
const channel = new BroadcastChannel('nhost')
// ? broadcast the signout event to other tabs to remove the accessToken
channel.postMessage({ type: 'signout' })
} catch (error) {
// * BroadcastChannel is not available e.g. react-native
}
return signOutResponse
},
signUpEmailPassword: async (context, { email, password, options }) => {
if (!isValidEmail(email)) {
return Promise.reject<SignUpResponse>({ error: INVALID_EMAIL_ERROR })

View File

@@ -1,5 +1,17 @@
# @nhost/hasura-storage-js
## 2.5.1
### Patch Changes
- 8512a7f: fix: fix types StorageGetUrlParams and StorageGetPresignedUrlParams to include missing StorageHeadersParam
## 2.5.0
### Minor Changes
- 304065a: feat: add `setHeaders` method enabling global configuration of storage, graphql, and functions client headers, alongside added support for passing specific headers with individual calls
## 2.4.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/hasura-storage-js",
"version": "2.4.0",
"version": "2.5.1",
"description": "Hasura-storage client",
"license": "MIT",
"keywords": [

Some files were not shown because too many files have changed in this diff Show More