Compare commits

...

30 Commits

Author SHA1 Message Date
github-actions[bot]
1230081ce6 chore: update versions (#2640)
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/dashboard@1.12.2

### Patch Changes

-   c195c51: fix: send email upon signin for unverified users

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-05 12:48:55 +01:00
Hassan Ben Jobrane
c195c517de fix: send email upon signin for unverified users (#2639) 2024-04-05 11:48:14 +01:00
github-actions[bot]
6f419be2c1 chore: update versions (#2634)
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.2.1

### Patch Changes

-   @nhost/nhost-js@3.0.11

## @nhost/react-apollo@11.0.1

### Patch Changes

-   @nhost/apollo@6.2.1
-   @nhost/react@3.4.1

## @nhost/react-urql@8.0.1

### Patch Changes

-   @nhost/react@3.4.1

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

### Patch Changes

-   bcd889b: fix: change expiresAt format to RFC3339 in createPATPromise

## @nhost/nextjs@2.1.10

### Patch Changes

-   @nhost/react@3.4.1

## @nhost/nhost-js@3.0.11

### Patch Changes

-   Updated dependencies [bcd889b]
    -   @nhost/hasura-auth-js@2.4.1

## @nhost/react@3.4.1

### Patch Changes

-   @nhost/nhost-js@3.0.11

## @nhost/vue@2.5.1

### Patch Changes

-   @nhost/nhost-js@3.0.11

## @nhost/docs@2.9.0

### Minor Changes

-   3c31657: chore: update docs with provider connect

### Patch Changes

-   992939c: feat: added social connect docs

## @nhost/dashboard@1.12.1

### Patch Changes

- 93ebdf8: fix: use service urls when initilizaing NhostClient running
local dashboard
    -   @nhost/react-apollo@11.0.1
    -   @nhost/nextjs@2.1.10

## @nhost-examples/cli@0.3.1

### Patch Changes

-   @nhost/nhost-js@3.0.11

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

### Patch Changes

-   @nhost/react@3.4.1
-   @nhost/react-apollo@11.0.1

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

### Patch Changes

-   @nhost/react@3.4.1

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

### Patch Changes

-   @nhost/react@3.4.1
-   @nhost/react-urql@8.0.1

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

### Patch Changes

-   @nhost/nhost-js@3.0.11

## @nhost-examples/nextjs@0.3.1

### Patch Changes

-   @nhost/react@3.4.1
-   @nhost/react-apollo@11.0.1
-   @nhost/nextjs@2.1.10

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

### Patch Changes

-   @nhost/nhost-js@3.0.11

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

### Patch Changes

-   @nhost/nhost-js@3.0.11

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

### Patch Changes

-   @nhost/react@3.4.1
-   @nhost/react-apollo@11.0.1

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

### Patch Changes

-   @nhost/react@3.4.1

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

### Patch Changes

-   @nhost/nhost-js@3.0.11
-   @nhost/apollo@6.2.1
-   @nhost/vue@2.5.1

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

### Patch Changes

-   @nhost/apollo@6.2.1
-   @nhost/vue@2.5.1

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-04 10:49:02 +01:00
Hassan Ben Jobrane
93ebdf844f fix: dashboard: use service urls when running locally with the cli (#2622) 2024-04-04 10:28:38 +01:00
Hassan Ben Jobrane
bcd889b53a fix: hasura-auth-js: use RFC3339 format for expiresAt when creating a PAT (#2637) 2024-04-03 21:40:02 +01:00
David Barroso
992939cdcd feat (docs): added social connect docs (#2633)
Co-authored-by: Nuno Pato <nunopato@gmail.com>
2024-04-03 16:37:07 +02:00
Nuno Pato
3c31657c50 chore: update docs with provider connect (#2632)
Co-authored-by: David Barroso <dbarrosop@dravetech.com>
2024-04-03 14:27:49 +00:00
github-actions[bot]
a654d536e0 chore: update versions (#2618)
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.2.0

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   @nhost/nhost-js@3.0.10

## @nhost/google-translation@0.2.0

### Minor Changes

-   768ca17: chore: update dependencies

## @nhost/react-apollo@11.0.0

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   Updated dependencies [768ca17]
    -   @nhost/apollo@6.2.0
    -   @nhost/react@3.4.0

## @nhost/react-urql@8.0.0

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   Updated dependencies [768ca17]
    -   @nhost/react@3.4.0

## @nhost/stripe-graphql-js@1.2.0

### Minor Changes

-   768ca17: chore: update dependencies

## @nhost/react@3.4.0

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   @nhost/nhost-js@3.0.10

## @nhost/vue@2.5.0

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   @nhost/nhost-js@3.0.10

## @nhost/nextjs@2.1.9

### Patch Changes

-   Updated dependencies [768ca17]
    -   @nhost/react@3.4.0

## @nhost/dashboard@1.12.0

### Minor Changes

- f242e4b: feat: add connect with github to the user's account settings
-   768ca17: chore: update dependencies
- d62bd0f: fix: "Track this" option within the SQL editor now correctly
updates the metadata
- 91c2bb6: feat: refactor sign-in and sign-up pages to enforce email
verification

### Patch Changes

-   943831f: fix: resolve an error toast issue when unpausing a project
-   Updated dependencies [768ca17]
    -   @nhost/react-apollo@11.0.0
    -   @nhost/nextjs@2.1.9

## @nhost/docs@2.8.0

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   9f2bf9e: chore: added hasura's authHook settings

## @nhost-examples/cli@0.3.0

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   @nhost/nhost-js@3.0.10

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

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   Updated dependencies [768ca17]
    -   @nhost/react-apollo@11.0.0
    -   @nhost/react@3.4.0

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

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   Updated dependencies [768ca17]
    -   @nhost/react@3.4.0

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

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   Updated dependencies [768ca17]
    -   @nhost/react-urql@8.0.0
    -   @nhost/react@3.4.0

## @nhost-examples/docker-compose@0.4.0

### Minor Changes

-   768ca17: chore: update dependencies

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

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   @nhost/nhost-js@3.0.10

## @nhost-examples/nextjs@0.3.0

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   Updated dependencies [768ca17]
    -   @nhost/react-apollo@11.0.0
    -   @nhost/react@3.4.0
    -   @nhost/nextjs@2.1.9

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

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   @nhost/nhost-js@3.0.10

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

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   @nhost/nhost-js@3.0.10

## @nhost-examples/sveltekit@0.4.0

### Minor Changes

-   768ca17: chore: update dependencies

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

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   863b37d: chore: bump hasura-auth
-   Updated dependencies [768ca17]
    -   @nhost/react-apollo@11.0.0
    -   @nhost/react@3.4.0

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

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   Updated dependencies [768ca17]
    -   @nhost/react@3.4.0

## @nhost-examples/serverless-functions@0.2.0

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   Updated dependencies [768ca17]
    -   @nhost/stripe-graphql-js@1.2.0

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

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   Updated dependencies [768ca17]
    -   @nhost/apollo@6.2.0
    -   @nhost/vue@2.5.0
    -   @nhost/nhost-js@3.0.10

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

### Minor Changes

-   768ca17: chore: update dependencies

### Patch Changes

-   Updated dependencies [768ca17]
    -   @nhost/apollo@6.2.0
    -   @nhost/vue@2.5.0

## @nhost/docgen@0.3.0

### Minor Changes

-   768ca17: chore: update dependencies

## @nhost/sync-versions@0.2.0

### Minor Changes

-   768ca17: chore: update dependencies

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Hassan Ben Jobrane <hsanbenjobrane@gmail.com>
2024-04-03 13:29:25 +01:00
Hassan Ben Jobrane
91c2bb6f53 feat: dashboard: restrict signup/signin to verified emails only (#2610)
resolves https://github.com/nhost/nhost/issues/2585
2024-04-03 12:52:47 +01:00
David Barroso
9f2bf9ec2b chore (docs): added hasura's authHook settings (#2630) 2024-04-03 09:01:28 +02:00
Nuno Pato
d62bd0fc9a fix: dashboard: SQL editor "track this" (#2626)
fixes https://github.com/nhost/nhost/issues/2625

---------

Co-authored-by: Hassan Ben Jobrane <hsanbenjobrane@gmail.com>
2024-04-02 16:50:26 +00:00
github-actions[bot]
768ca17494 [Scheduled] Update dependencies (#2627)
Dependencies updated

Note - If you see this PR and the checks haven't run, close and reopen
the PR. See
https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs

---------

Co-authored-by: dbarrosop <dbarrosop@users.noreply.github.com>
Co-authored-by: Hassan Ben Jobrane <hsanbenjobrane@gmail.com>
2024-04-02 16:44:24 +01:00
Hassan Ben Jobrane
943831fe2e fix: await unpauseApplication promise (#2621)
fixes https://github.com/nhost/nhost/issues/2620
2024-03-26 09:29:10 +01:00
Hassan Ben Jobrane
f242e4b92f feat: connect with github (#2616)
fixes https://github.com/nhost/nhost/issues/2581
2024-03-25 13:22:15 +01:00
David Barroso
863b37d313 chore (examples/apollo): bump hasura-auth (#2617) 2024-03-23 12:07:22 +01:00
github-actions[bot]
c8a8d4fca3 chore: update versions (#2609)
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/hasura-auth-js@2.4.0

### Minor Changes

- 311374e: fix: ensure that the user remains signed in even after being
redirected with an error following an attempt to connect with a social
provider

### Patch Changes

-   1623e9b: chore: update `@simplewebauthn/browser` to `9.0.1`

## @nhost/vue@2.4.0

### Minor Changes

-   311374e: feat: add `connect` param to `useProviderLink` hook

### Patch Changes

-   @nhost/nhost-js@3.0.10

## @nhost/apollo@6.1.2

### Patch Changes

-   @nhost/nhost-js@3.0.10

## @nhost/react-apollo@10.0.2

### Patch Changes

-   Updated dependencies [311374e]
    -   @nhost/react@3.3.2
    -   @nhost/apollo@6.1.2

## @nhost/react-urql@7.0.2

### Patch Changes

-   Updated dependencies [311374e]
    -   @nhost/react@3.3.2

## @nhost/nextjs@2.1.8

### Patch Changes

-   Updated dependencies [311374e]
    -   @nhost/react@3.3.2

## @nhost/nhost-js@3.0.10

### Patch Changes

-   Updated dependencies [1623e9b]
-   Updated dependencies [311374e]
    -   @nhost/hasura-auth-js@2.4.0

## @nhost/react@3.3.2

### Patch Changes

-   311374e: feat: add `connect` param to `useProviderLink` hook
    -   @nhost/nhost-js@3.0.10

## @nhost-examples/docker-compose@0.3.0

### Minor Changes

- e40a452: chore: clarification on greyed-out options in the dashboard
when self-hosting

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

### Minor Changes

- 311374e: feat: add example of how to connect a social auth provider to
an existing account

### Patch Changes

-   Updated dependencies [311374e]
    -   @nhost/react@3.3.2
    -   @nhost/react-apollo@10.0.2

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

### Minor Changes

- 311374e: feat: add example of how to connect a social auth provider to
an existing account

### Patch Changes

-   Updated dependencies [311374e]
    -   @nhost/vue@2.4.0
    -   @nhost/nhost-js@3.0.10
    -   @nhost/apollo@6.1.2

## @nhost/dashboard@1.11.2

### Patch Changes

-   @nhost/react-apollo@10.0.2
-   @nhost/nextjs@2.1.8

## @nhost/docs@2.7.2

### Patch Changes

-   5c47e8e: feat: added hasura's stringifyNumericTypes setting

## @nhost-examples/cli@0.2.2

### Patch Changes

-   @nhost/nhost-js@3.0.10

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

### Patch Changes

-   Updated dependencies [311374e]
    -   @nhost/react@3.3.2
    -   @nhost/react-apollo@10.0.2

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

### Patch Changes

-   Updated dependencies [311374e]
    -   @nhost/react@3.3.2

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

### Patch Changes

-   Updated dependencies [311374e]
    -   @nhost/react@3.3.2
    -   @nhost/react-urql@7.0.2

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

### Patch Changes

-   @nhost/nhost-js@3.0.10

## @nhost-examples/nextjs@0.2.2

### Patch Changes

-   Updated dependencies [311374e]
    -   @nhost/react@3.3.2
    -   @nhost/react-apollo@10.0.2
    -   @nhost/nextjs@2.1.8

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

### Patch Changes

-   @nhost/nhost-js@3.0.10

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

### Patch Changes

-   @nhost/nhost-js@3.0.10

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

### Patch Changes

-   Updated dependencies [311374e]
    -   @nhost/react@3.3.2

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

### Patch Changes

-   Updated dependencies [311374e]
    -   @nhost/vue@2.4.0
    -   @nhost/apollo@6.1.2

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-21 17:54:02 +01:00
Hassan Ben Jobrane
311374e3fb feat: react-apollo: add example of how to connect github to an existing account (#2615)
fixes https://github.com/nhost/nhost/issues/2582
2024-03-21 17:38:54 +01:00
Seth Deegan
e40a4529b4 chore (examples/docker-compose): clarification on greyed-out options in the dashboard when self-hosting (#2564) 2024-03-18 11:03:10 +01:00
Hassan Ben Jobrane
1623e9bd20 chore: hasura-auth-js: upgrade @simplewebauthn/browser to 9.0.1 (#2611)
fixes https://github.com/nhost/nhost/issues/2597
2024-03-13 17:25:29 +01:00
David Barroso
5c47e8e675 feat (docs): added hasura's stringifyNumericTypes setting (#2608) 2024-03-12 11:29:53 +01:00
github-actions[bot]
9f9f1c64f4 chore: update versions (#2605)
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/dashboard@1.11.1

### Patch Changes

-   981404f: fix: set default value for healthCheck field validation

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-11 11:02:17 +01:00
Hassan Ben Jobrane
981404f0b9 fix(dashboard): set default value for healthCheck field validation (#2604) 2024-03-11 10:45:33 +01:00
github-actions[bot]
4ad27e9d72 chore: update versions (#2599)
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.1.1

### Patch Changes

-   @nhost/nhost-js@3.0.9

## @nhost/react-apollo@10.0.1

### Patch Changes

-   @nhost/apollo@6.1.1
-   @nhost/react@3.3.1

## @nhost/react-urql@7.0.1

### Patch Changes

-   @nhost/react@3.3.1

## @nhost/stripe-graphql-js@1.1.1

### Patch Changes

-   7789469: chore: address linter errors and remove unnecessary imports

## @nhost/graphql-js@0.1.9

### Patch Changes

- 7789469: fix: resolve process is undefined error when running with
vitejs

## @nhost/nextjs@2.1.7

### Patch Changes

-   @nhost/react@3.3.1

## @nhost/nhost-js@3.0.9

### Patch Changes

-   Updated dependencies [7789469]
    -   @nhost/graphql-js@0.1.9

## @nhost/react@3.3.1

### Patch Changes

-   @nhost/nhost-js@3.0.9

## @nhost/vue@2.3.1

### Patch Changes

-   @nhost/nhost-js@3.0.9

## @nhost/dashboard@1.11.0

### Minor Changes

- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2`
to address vulnerability
- 6c11b75: feat: add update user displayName section in account settings

### Patch Changes

-   @nhost/react-apollo@10.0.1
-   @nhost/nextjs@2.1.7

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

### Minor Changes

- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2`
to address vulnerability

### Patch Changes

-   @nhost/react@3.3.1
-   @nhost/react-apollo@10.0.1

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

### Minor Changes

- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2`
to address vulnerability

### Patch Changes

-   @nhost/react@3.3.1

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

### Minor Changes

- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2`
to address vulnerability

### Patch Changes

-   @nhost/react@3.3.1
-   @nhost/react-urql@7.0.1

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

### Minor Changes

- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2`
to address vulnerability

### Patch Changes

-   @nhost/react@3.3.1
-   @nhost/react-apollo@10.0.1

## @nhost-examples/cli@0.2.1

### Patch Changes

-   @nhost/nhost-js@3.0.9

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

### Patch Changes

-   @nhost/nhost-js@3.0.9

## @nhost-examples/nextjs@0.2.1

### Patch Changes

-   @nhost/react@3.3.1
-   @nhost/react-apollo@10.0.1
-   @nhost/nextjs@2.1.7

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

### Patch Changes

-   @nhost/nhost-js@3.0.9

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

### Patch Changes

-   @nhost/nhost-js@3.0.9

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

### Patch Changes

-   @nhost/react@3.3.1

## @nhost-examples/serverless-functions@0.1.1

### Patch Changes

-   Updated dependencies [7789469]
    -   @nhost/stripe-graphql-js@1.1.1

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

### Patch Changes

-   7789469: chore: address linter errors and remove unnecessary imports
    -   @nhost/nhost-js@3.0.9
    -   @nhost/apollo@6.1.1
    -   @nhost/vue@2.3.1

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

### Patch Changes

-   @nhost/apollo@6.1.1
-   @nhost/vue@2.3.1

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-08 15:51:16 +01:00
Hassan Ben Jobrane
778946998a fix: graphql-js: resolve process is undefined error when running with vitejs (#2601)
fixes https://github.com/nhost/nhost/issues/2600
2024-03-08 15:23:13 +01:00
Hassan Ben Jobrane
6c11b75807 feat: dashboard: add update user displayName section in account settings (#2598)
fixes https://github.com/nhost/nhost/issues/1489
2024-03-07 17:23:35 +01:00
github-actions[bot]
2dc031d16c chore: update versions (#2592)
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-examples/react-apollo@0.5.0

### Minor Changes

- 08a7dd9: feat: add example workaround to the reset password ticket
expired issue

### Patch Changes

- f0a994a: fix: update allowedUrls and redirectTo to point to the
profile page

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

### Minor Changes

- 08a7dd9: feat: add example workaround to the reset password ticket
expired issue

### Patch Changes

- f0a994a: fix: update allowedUrls and redirectTo to point to the
profile page

## @nhost/docs@2.7.1

### Patch Changes

-   6cb2b63: feat: added nhost run env documentation
-   40bd3e4: fix: fixed wrong links in documentation

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-06 16:56:26 +01:00
Nicolas Bourdin
40bd3e4572 doc(link): fix wrong links in documentation (#2596)
Co-authored-by: Nicolas Bourdin <nicolas@epeak.co>
Co-authored-by: David Barroso <dbarrosop@dravetech.com>
2024-03-06 14:50:32 +01:00
David Barroso
6cb2b6331a feat (docs): added nhost run env documentation (#2594) 2024-03-06 14:13:02 +01:00
Hassan Ben Jobrane
08a7dd9894 feat(examples): add reset password ticket expired workarounds in the examples (#2590)
fixes https://github.com/nhost/nhost/issues/2314
2024-03-05 15:48:46 +01:00
Hassan Ben Jobrane
f0a994a26e fix(examples): update allowedUrls and redirectTo to point to /profile (#2591) 2024-03-05 14:17:01 +01:00
176 changed files with 5730 additions and 4173 deletions

View File

@@ -1,5 +1,60 @@
# @nhost/dashboard
## 1.12.2
### Patch Changes
- c195c51: fix: send email upon signin for unverified users
## 1.12.1
### Patch Changes
- 93ebdf8: fix: use service urls when initilizaing NhostClient running local dashboard
- @nhost/react-apollo@11.0.1
- @nhost/nextjs@2.1.10
## 1.12.0
### Minor Changes
- f242e4b: feat: add connect with github to the user's account settings
- 768ca17: chore: update dependencies
- d62bd0f: fix: "Track this" option within the SQL editor now correctly updates the metadata
- 91c2bb6: feat: refactor sign-in and sign-up pages to enforce email verification
### Patch Changes
- 943831f: fix: resolve an error toast issue when unpausing a project
- Updated dependencies [768ca17]
- @nhost/react-apollo@11.0.0
- @nhost/nextjs@2.1.9
## 1.11.2
### Patch Changes
- @nhost/react-apollo@10.0.2
- @nhost/nextjs@2.1.8
## 1.11.1
### Patch Changes
- 981404f: fix: set default value for healthCheck field validation
## 1.11.0
### Minor Changes
- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2` to address vulnerability
- 6c11b75: feat: add update user displayName section in account settings
### Patch Changes
- @nhost/react-apollo@10.0.1
- @nhost/nextjs@2.1.7
## 1.10.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "1.10.0",
"version": "1.12.2",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
@@ -19,34 +19,34 @@
"e2e": "pnpm install-browsers && pnpm playwright test"
},
"dependencies": {
"@apollo/client": "^3.9.5",
"@codemirror/lang-sql": "^6.6.0",
"@apollo/client": "^3.9.9",
"@codemirror/lang-sql": "^6.6.2",
"@emotion/cache": "^11.11.0",
"@emotion/react": "^11.11.4",
"@emotion/server": "^11.11.0",
"@emotion/styled": "^11.11.0",
"@fontsource/inter": "^5.0.16",
"@fontsource/roboto-mono": "^5.0.16",
"@emotion/styled": "^11.11.5",
"@fontsource/inter": "^5.0.17",
"@fontsource/roboto-mono": "^5.0.17",
"@graphiql/react": "^0.20.3",
"@graphiql/toolkit": "^0.9.1",
"@headlessui/react": "^1.7.18",
"@heroicons/react": "^1.0.6",
"@hookform/resolvers": "^3.3.4",
"@mui/base": "5.0.0-beta.31",
"@mui/material": "^5.15.11",
"@mui/system": "^5.15.11",
"@mui/material": "^5.15.14",
"@mui/system": "^5.15.14",
"@mui/x-date-pickers": "^5.0.20",
"@nhost/nextjs": "workspace:*",
"@nhost/react-apollo": "workspace:*",
"@segment/snippet": "^4.16.2",
"@stripe/react-stripe-js": "^2.5.1",
"@stripe/react-stripe-js": "^2.6.2",
"@stripe/stripe-js": "^1.54.2",
"@tailwindcss/forms": "^0.5.7",
"@tanstack/react-query": "^4.36.1",
"@tanstack/react-table": "^8.13.2",
"@tanstack/react-virtual": "^3.1.3",
"@uiw/codemirror-theme-github": "^4.21.24",
"@uiw/react-codemirror": "^4.21.24",
"@tanstack/react-table": "^8.15.3",
"@tanstack/react-virtual": "^3.2.0",
"@uiw/codemirror-theme-github": "^4.21.25",
"@uiw/react-codemirror": "^4.21.25",
"analytics-node": "^6.2.0",
"bcryptjs": "^2.4.3",
"clsx": "^1.2.1",
@@ -57,10 +57,10 @@
"graphql": "16.8.1",
"graphql-request": "^6.1.0",
"graphql-tag": "^2.12.6",
"graphql-ws": "^5.15.0",
"graphql-ws": "^5.16.0",
"just-kebab-case": "^4.2.0",
"lodash.debounce": "^4.0.8",
"next": "^14.1.0",
"next": "^14.1.4",
"next-seo": "^6.5.0",
"node-pg-format": "^1.3.5",
"pluralize": "^8.0.0",
@@ -68,7 +68,7 @@
"react-children-utilities": "^2.10.0",
"react-dom": "18.2.0",
"react-error-boundary": "^4.0.13",
"react-hook-form": "^7.50.1",
"react-hook-form": "^7.51.2",
"react-hot-toast": "^2.4.1",
"react-intersection-observer": "^9.8.1",
"react-is": "18.2.0",
@@ -87,13 +87,13 @@
"tailwind-merge": "^1.14.0",
"utility-types": "^3.11.0",
"validator": "^13.11.0",
"yup": "^1.3.3",
"yup": "^1.4.0",
"yup-password": "^0.2.2"
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@babel/core": "^7.24.3",
"@faker-js/faker": "^7.6.0",
"@graphql-codegen/cli": "^3.3.1",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/typescript": "^3.0.4",
"@graphql-codegen/typescript-operations": "^3.0.4",
"@graphql-codegen/typescript-react-apollo": "^3.3.7",
@@ -108,20 +108,20 @@
"@storybook/manager-webpack5": "^6.5.16",
"@storybook/react": "^7.6.17",
"@storybook/testing-library": "^0.2.2",
"@tailwindcss/typography": "^0.5.10",
"@tailwindcss/typography": "^0.5.12",
"@testing-library/dom": "^9.3.4",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.2.1",
"@testing-library/react": "^14.2.2",
"@testing-library/user-event": "^14.5.2",
"@types/ace": "^0.0.48",
"@types/bcryptjs": "^2.4.6",
"@types/jest": "^29.5.12",
"@types/lodash.debounce": "^4.0.9",
"@types/node": "^16.18.86",
"@types/node": "^16.18.93",
"@types/pluralize": "^0.0.30",
"@types/react": "^18.2.61",
"@types/react-dom": "^18.2.19",
"@types/react-table": "^7.7.19",
"@types/react": "^18.2.73",
"@types/react-dom": "^18.2.23",
"@types/react-table": "^7.7.20",
"@types/shell-quote": "^1.7.5",
"@types/testing-library__jest-dom": "^5.14.9",
"@types/validator": "^13.11.9",
@@ -129,7 +129,7 @@
"@typescript-eslint/parser": "^6.21.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^0.32.4",
"autoprefixer": "^10.4.17",
"autoprefixer": "^10.4.19",
"babel-loader": "^8.3.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"csstype": "^3.1.3",
@@ -142,14 +142,14 @@
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"jsdom": "^22.1.0",
"lint-staged": "^15.2.2",
"msw": "^1.3.2",
"msw": "^1.3.3",
"msw-storybook-addon": "^1.10.0",
"node-fetch": "^3.3.2",
"postcss": "^8.4.35",
"postcss": "^8.4.38",
"prettier": "^2.8.8",
"prettier-plugin-organize-imports": "^3.2.4",
"prettier-plugin-tailwindcss": "^0.4.1",
@@ -157,11 +157,11 @@
"require-from-string": "^2.0.2",
"snake-case": "^3.0.4",
"storybook-addon-next-router": "^4.0.2",
"tailwindcss": "^3.4.1",
"tailwindcss": "^3.4.3",
"ts-node": "^10.9.2",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"vite": "^5.1.4",
"vite-tsconfig-paths": "^4.3.1",
"vite": "^5.2.7",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^0.32.4"
},
"browserslist": {

View File

@@ -0,0 +1,85 @@
import { Form } from '@/components/form/Form';
import { SettingsContainer } from '@/components/layout/SettingsContainer';
import { Input } from '@/components/ui/v2/Input';
import { execPromiseWithErrorToast } from '@/utils/execPromiseWithErrorToast';
import { useUpdateUserDisplayNameMutation } from '@/utils/__generated__/graphql';
import { yupResolver } from '@hookform/resolvers/yup';
import { useUserData } from '@nhost/nextjs';
import { FormProvider, useForm } from 'react-hook-form';
import * as Yup from 'yup';
const validationSchema = Yup.object({
displayName: Yup.string()
.label('Display Name')
.required('This field is required.'),
});
export type DisplayNameSettingFormValues = Yup.InferType<
typeof validationSchema
>;
export default function DisplayNameSetting() {
const { id: userID, displayName } = useUserData();
const [updateUserDisplayName] = useUpdateUserDisplayNameMutation();
const form = useForm<DisplayNameSettingFormValues>({
reValidateMode: 'onSubmit',
defaultValues: {
displayName,
},
resolver: yupResolver(validationSchema),
});
const { register, formState } = form;
const isDirty = Object.keys(formState.dirtyFields).length > 0;
async function handleSubmit(formValues: DisplayNameSettingFormValues) {
await execPromiseWithErrorToast(
async () => {
await updateUserDisplayName({
variables: {
id: userID,
displayName: formValues.displayName,
},
});
form.reset({ displayName: formValues.displayName });
},
{
loadingMessage: 'Updating your display name...',
successMessage: 'Your display name has been updated successfully.',
errorMessage:
'An error occurred while trying to update your display name. Please try again.',
},
);
}
return (
<FormProvider {...form}>
<Form onSubmit={handleSubmit}>
<SettingsContainer
title="Update your display name"
slotProps={{
submitButton: {
disabled: !isDirty,
loading: formState.isSubmitting,
},
}}
className="grid grid-flow-row lg:grid-cols-5"
>
<Input
{...register('displayName')}
className="col-span-2"
type="text"
id="display-name"
label="Display Name"
fullWidth
helperText={formState.errors.displayName?.message}
error={Boolean(formState.errors.displayName)}
/>
</SettingsContainer>
</Form>
</FormProvider>
);
}

View File

@@ -0,0 +1,2 @@
export * from './DisplayNameSetting';
export { default as DisplayNameSetting } from './DisplayNameSetting';

View File

@@ -0,0 +1,76 @@
import { SettingsContainer } from '@/components/layout/SettingsContainer';
import { ActivityIndicator } from '@/components/ui/v2/ActivityIndicator';
import { Box } from '@/components/ui/v2/Box';
import { Button } from '@/components/ui/v2/Button';
import { GitHubIcon } from '@/components/ui/v2/icons/GitHubIcon';
import { Text } from '@/components/ui/v2/Text';
import { useGetAuthUserProvidersQuery } from '@/utils/__generated__/graphql';
import { useProviderLink } from '@nhost/nextjs';
import NavLink from 'next/link';
export default function SocialProvidersSettings() {
const { data, loading, error } = useGetAuthUserProvidersQuery();
const isGithubConnected = data?.authUserProviders?.some(
(item) => item.providerId === 'github',
);
const { github } = useProviderLink({
connect: true,
redirectTo: `${window.location.origin}/account`,
});
if (!data && loading) {
return (
<ActivityIndicator
delay={1000}
label="Loading personal access tokens..."
/>
);
}
if (error) {
throw error;
}
return (
<SettingsContainer
title="Authentication providers"
description=""
rootClassName="gap-0 flex flex-col items-start"
className="my-2"
slotProps={{
submitButton: { className: 'hidden' },
footer: { className: 'hidden' },
}}
>
{isGithubConnected ? (
<Box
sx={{ backgroundColor: 'grey.200' }}
className="flex flex-row items-center justify-start space-x-2 rounded-md p-2"
>
<GitHubIcon />
<Text className="font-medium ">Connected</Text>
</Box>
) : (
<Box>
<NavLink
href={github}
passHref
target="_blank"
rel="noreferrer noopener"
legacyBehavior
>
<Button
className=""
variant="outlined"
color="secondary"
startIcon={<GitHubIcon />}
>
Connect with GitHub
</Button>
</NavLink>
</Box>
)}
</SettingsContainer>
);
}

View File

@@ -0,0 +1 @@
export { default as SocialProvidersSettings } from './SocialProvidersSettings';

View File

@@ -0,0 +1,6 @@
query getAuthUserProviders {
authUserProviders {
id
providerId
}
}

View File

@@ -0,0 +1,6 @@
mutation updateUserDisplayName($id: uuid!, $displayName: String!) {
updateUser(pk_columns: { id: $id }, _set: { displayName: $displayName }) {
id
displayName
}
}

View File

@@ -1,5 +1,6 @@
import { useDatabaseQuery } from '@/features/database/dataGrid/hooks/useDatabaseQuery';
import { useCurrentWorkspaceAndProject } from '@/features/projects/common/hooks/useCurrentWorkspaceAndProject';
import { useIsPlatform } from '@/features/projects/common/hooks/useIsPlatform';
import { generateAppServiceUrl } from '@/features/projects/common/utils/generateAppServiceUrl';
import { getToastStyleProps } from '@/utils/constants/settings';
import { getHasuraAdminSecret } from '@/utils/env';
@@ -17,6 +18,7 @@ export default function useRunSQL(
migrationName: string,
) {
const { currentProject } = useCurrentWorkspaceAndProject();
const isPlatform = useIsPlatform();
const [loading, setLoading] = useState(false);
const [commandOk, setCommandOk] = useState(false);
@@ -179,8 +181,34 @@ export default function useRunSQL(
}
};
const trackAll = async (objects: any[]): Promise<Response[]> => {
const apiPath = isPlatform ? '/v1/metadata' : '/apis/migrate';
const responses: Response[] = await Promise.all(
objects.map((object) =>
fetch(`${appUrl}${apiPath}`, {
method: 'POST',
headers: { 'x-hasura-admin-secret': adminSecret },
body: JSON.stringify(object),
}).then((response) => {
if (!response.ok) {
console.error('failed to track:', response);
}
return response;
}),
),
).catch((error) => {
console.error('Error in trackAll:', error);
throw error;
});
return responses;
};
const updateMetadata = async (inputSQL: string) => {
const entities = parseIdentifiersFromSQL(inputSQL);
if (entities.length === 0) {
return;
}
const tablesOrViewEntities = entities.filter(
(entity) => entity.type !== 'function',
@@ -189,47 +217,75 @@ export default function useRunSQL(
(entity) => entity.type === 'function',
);
const trackTablesOrViews = tablesOrViewEntities.map(({ name, schema }) => ({
type: 'pg_track_table',
args: {
source: 'default',
table: {
name,
schema,
let trackTablesOrViews: any[] = [];
let trackFunctions: any[] = [];
if (isPlatform) {
// use v2/query
trackTablesOrViews = tablesOrViewEntities.map(({ name, schema }) => ({
type: 'pg_track_table',
args: {
source: 'default',
table: {
name,
schema,
},
},
},
}));
const trackFunctions = functionEntities.map(({ name, schema }) => ({
type: 'pg_track_function',
args: {
source: 'default',
function: {
name,
schema,
configuration: {},
}));
trackFunctions = functionEntities.map(({ name, schema }) => ({
type: 'pg_track_function',
args: {
source: 'default',
function: {
name,
schema,
configuration: {},
},
},
},
}));
const metaDataPayload = {
source: 'default',
type: 'bulk',
args: [...trackTablesOrViews, ...trackFunctions],
};
}));
} else {
// use apis/migrate
trackTablesOrViews = tablesOrViewEntities.map(({ name, schema }) => ({
name: `add_existing_table_or_view_${schema}_${name}`,
datasource: 'default',
down: [],
skip_execution: false,
up: [
{
type: 'pg_track_table',
args: {
table: { name, schema },
source: 'default',
},
},
],
}));
trackFunctions = functionEntities.map(({ name, schema }) => ({
name: `add_existing_function_or_view_${schema}_${name}`,
datasource: 'default',
down: [],
skip_execution: false,
up: [
{
type: 'pg_track_function',
args: {
function: { name, schema },
source: 'default',
},
},
],
}));
}
try {
if (entities.length > 0) {
const metadataApiResponse = await fetch(`${appUrl}/v1/metadata`, {
method: 'POST',
headers: { 'x-hasura-admin-secret': adminSecret },
body: JSON.stringify(metaDataPayload),
});
if (!metadataApiResponse.ok) {
throw new Error('Metadata API call failed');
}
}
await trackAll([...trackTablesOrViews, ...trackFunctions]).then(
(responses) => {
responses.forEach((response) => {
if (!response.ok) {
console.error('Error tracking table or view:', response);
}
});
},
);
} catch (error) {
toast.error('An error happened when calling the metadata API', {
style: toastStyle.style,

View File

@@ -47,7 +47,7 @@ export default function ApplicationPaused() {
async function handleTriggerUnpausing() {
await execPromiseWithErrorToast(
async () => {
unpauseApplication({ variables: { appId: currentProject.id } });
await unpauseApplication({ variables: { appId: currentProject.id } });
await refetchWorkspaceAndProject();
},
{

View File

@@ -25,12 +25,12 @@ function Plan({ planName, price, setPlan, planId, selectedPlanId }: any) {
return (
<button
type="button"
className="grid items-center justify-between w-full grid-flow-col gap-2 px-1 my-4"
className="my-4 grid w-full grid-flow-col items-center justify-between gap-2 px-1"
onClick={setPlan}
tabIndex={-1}
>
<div className="grid grid-flow-row gap-y-0.5">
<div className="grid items-center justify-start grid-flow-col gap-2">
<div className="grid grid-flow-col items-center justify-start gap-2">
<Checkbox
onChange={setPlan}
checked={selectedPlanId === planId}
@@ -40,7 +40,7 @@ function Plan({ planName, price, setPlan, planId, selectedPlanId }: any) {
<Text
variant="h3"
component="p"
className="self-center font-medium text-left"
className="self-center text-left font-medium"
>
Upgrade to {planName}
</Text>
@@ -119,7 +119,7 @@ export function ChangePlanModalWithData({ app, plans, close }: any) {
const handleUpdateAppPlan = async () => {
await execPromiseWithErrorToast(
async () => {
updateApp({
await updateApp({
variables: {
appId: app.id,
app: {
@@ -156,7 +156,7 @@ export function ChangePlanModalWithData({ app, plans, close }: any) {
if (pollingCurrentProject) {
return (
<Box className="w-full max-w-xl p-6 mx-auto text-left rounded-lg">
<Box className="mx-auto w-full max-w-xl rounded-lg p-6 text-left">
<div className="flex flex-col">
<div className="mx-auto">
<Image
@@ -179,7 +179,7 @@ export function ChangePlanModalWithData({ app, plans, close }: any) {
<Button
variant="outlined"
color="secondary"
className="w-full max-w-sm mx-auto mt-4"
className="mx-auto mt-4 w-full max-w-sm"
onClick={() => {
if (close) {
close();
@@ -196,7 +196,7 @@ export function ChangePlanModalWithData({ app, plans, close }: any) {
}
return (
<Box className="w-full max-w-xl p-6 text-left rounded-lg">
<Box className="w-full max-w-xl rounded-lg p-6 text-left">
<BaseDialog
open={showPaymentModal}
onClose={() => setShowPaymentModal(false)}
@@ -241,7 +241,7 @@ export function ChangePlanModalWithData({ app, plans, close }: any) {
))}
</div>
<div className="grid grid-flow-row gap-2 mt-2">
<div className="mt-2 grid grid-flow-row gap-2">
<Button
onClick={handleChangePlanClick}
disabled={!selectedPlan}

View File

@@ -47,7 +47,8 @@ export const validationSchema = Yup.object({
initialDelaySeconds: Yup.number().required(),
probePeriodSeconds: Yup.number().required(),
})
.nullable(),
.nullable()
.default(undefined),
});
export type ServiceFormValues = Yup.InferType<typeof validationSchema>;

View File

@@ -1,4 +1,4 @@
fragment EnvironmentVariable on ConfigEnvironmentVariable {
fragment EnvironmentVariable on ConfigGlobalEnvironmentVariable {
id: name
name
value

View File

@@ -2,8 +2,10 @@ import { Container } from '@/components/layout/Container';
import { RetryableErrorBoundary } from '@/components/presentational/RetryableErrorBoundary';
import { AccountSettingsLayout } from '@/features/account/settings/components/AccountSettingsLayout';
import { DeleteAccount } from '@/features/account/settings/components/DeleteAccount';
import { DisplayNameSetting } from '@/features/account/settings/components/DisplayNameSetting';
import { PasswordSettings } from '@/features/account/settings/components/PasswordSettings';
import { PATSettings } from '@/features/account/settings/components/PATSettings';
import { SocialProvidersSettings } from '@/features/account/settings/components/SocialProvidersSettings';
import type { ReactElement } from 'react';
export default function AccountSettingsPage() {
@@ -12,10 +14,18 @@ export default function AccountSettingsPage() {
className="grid max-w-5xl grid-flow-row gap-8 bg-transparent"
rootClassName="bg-transparent"
>
<RetryableErrorBoundary>
<DisplayNameSetting />
</RetryableErrorBoundary>
<RetryableErrorBoundary>
<PasswordSettings />
</RetryableErrorBoundary>
<RetryableErrorBoundary>
<SocialProvidersSettings />
</RetryableErrorBoundary>
<RetryableErrorBoundary>
<PATSettings />
</RetryableErrorBoundary>

View File

@@ -0,0 +1,94 @@
import { NavLink } from '@/components/common/NavLink';
import { UnauthenticatedLayout } from '@/components/layout/UnauthenticatedLayout';
import { Box } from '@/components/ui/v2/Box';
import { Button } from '@/components/ui/v2/Button';
import { Text } from '@/components/ui/v2/Text';
import { getToastStyleProps } from '@/utils/constants/settings';
import { useNhostClient } from '@nhost/nextjs';
import { useRouter } from 'next/router';
import { useEffect, useState, type ReactElement } from 'react';
import { toast } from 'react-hot-toast';
export default function VerifyEmailPage() {
const router = useRouter();
const nhost = useNhostClient();
const {
query: { email },
} = router;
const [resendVerificationEmailLoading, setResendVerificationEmailLoading] =
useState(false);
useEffect(() => {
if (!email) {
router.push('/signin');
}
}, [email, router]);
const resendVerificationEmail = async () => {
setResendVerificationEmailLoading(true);
try {
await nhost.auth.sendVerificationEmail({ email: email as string });
toast.success(
`An new email has been sent to ${email}. Please follow the link to verify your email address and to
complete your registration.`,
getToastStyleProps(),
);
} catch {
toast.error(
'An error occurred while sending the verification email. Please try again.',
getToastStyleProps(),
);
} finally {
setResendVerificationEmailLoading(false);
}
};
return (
<>
<Text
variant="h2"
component="h1"
className="text-center text-3.5xl font-semibold lg:text-4.5xl"
>
Verify your email
</Text>
<Box className="grid grid-flow-row gap-4 rounded-md border bg-transparent p-6 lg:p-12">
<div className="relative py-2">
<Text color="secondary" className="text-center text-sm">
Please check your inbox for the verification email. Follow the link
to verify your email address and complete your registration.
</Text>
</div>
<Button
className="!bg-white !text-black disabled:!text-black disabled:!text-opacity-60"
size="large"
disabled={resendVerificationEmailLoading}
loading={resendVerificationEmailLoading}
type="button"
onClick={resendVerificationEmail}
>
Resend verification email
</Button>
<div className="flex justify-center">
<NavLink href="/signin" color="white" className="font-medium">
Sign In
</NavLink>
</div>
</Box>
</>
);
}
VerifyEmailPage.getLayout = function getLayout(page: ReactElement) {
return (
<UnauthenticatedLayout title="Verify your email">
{page}
</UnauthenticatedLayout>
);
};

View File

@@ -8,9 +8,9 @@ import { Text } from '@/components/ui/v2/Text';
import { getToastStyleProps } from '@/utils/constants/settings';
import { yupResolver } from '@hookform/resolvers/yup';
import { styled } from '@mui/material';
import { useSignInEmailPassword } from '@nhost/nextjs';
import type { ReactElement } from 'react';
import { useEffect } from 'react';
import { useNhostClient, useSignInEmailPassword } from '@nhost/nextjs';
import { useRouter } from 'next/router';
import { useEffect, type ReactElement } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
import { toast } from 'react-hot-toast';
import * as Yup from 'yup';
@@ -30,6 +30,8 @@ const StyledInput = styled(Input)({
});
export default function EmailSignUpPage() {
const router = useRouter();
const nhost = useNhostClient();
const { signInEmailPassword, error } = useSignInEmailPassword();
const form = useForm<EmailSignUpFormValues>({
@@ -56,7 +58,15 @@ export default function EmailSignUpPage() {
async function handleSubmit({ email, password }: EmailSignUpFormValues) {
try {
await signInEmailPassword(email, password);
const { needsEmailVerification } = await signInEmailPassword(
email,
password,
);
if (needsEmailVerification) {
await nhost.auth.sendVerificationEmail({ email: email as string });
router.push(`/email/verify?email=${email}`);
}
} catch {
toast.error(
'An error occurred while signing in. Please try again.',
@@ -75,7 +85,7 @@ export default function EmailSignUpPage() {
Sign In
</Text>
<Box className="grid grid-flow-row gap-4 rounded-md border bg-transparent p-6 lg:p-12">
<Box className="grid grid-flow-row gap-4 p-6 bg-transparent border rounded-md lg:p-12">
<FormProvider {...form}>
<Form
onSubmit={handleSubmit}
@@ -115,7 +125,7 @@ export default function EmailSignUpPage() {
<NavLink
href="/reset-password"
color="white"
className="justify-self-start font-semibold"
className="font-semibold justify-self-start"
>
Forgot password?
</NavLink>
@@ -140,7 +150,7 @@ export default function EmailSignUpPage() {
</FormProvider>
</Box>
<Text color="secondary" className="text-center text-base lg:text-lg">
<Text color="secondary" className="text-base text-center lg:text-lg">
Don&apos;t have an account?{' '}
<NavLink href="/signup" color="white">
Sign Up

View File

@@ -12,6 +12,7 @@ import { nhost } from '@/utils/nhost';
import { yupResolver } from '@hookform/resolvers/yup';
import { styled } from '@mui/material';
import { useSignUpEmailPassword } from '@nhost/nextjs';
import { useRouter } from 'next/router';
import type { ReactElement } from 'react';
import { useEffect, useState } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
@@ -36,6 +37,7 @@ const StyledInput = styled(Input)({
export default function SignUpPage() {
const { signUpEmailPassword, error } = useSignUpEmailPassword();
const [loading, setLoading] = useState(false);
const router = useRouter();
const form = useForm<SignUpFormValues>({
reValidateMode: 'onSubmit',
@@ -65,7 +67,15 @@ export default function SignUpPage() {
displayName,
}: SignUpFormValues) {
try {
await signUpEmailPassword(email, password, { displayName });
const { needsEmailVerification } = await signUpEmailPassword(
email,
password,
{ displayName },
);
if (needsEmailVerification) {
router.push(`/email/verify?email=${email}`);
}
} catch {
toast.error(
'An error occurred while signing up. Please try again.',

View File

@@ -1272,22 +1272,47 @@ export type ConfigFunctionsUpdateInput = {
export type ConfigGlobal = {
__typename?: 'ConfigGlobal';
/** User-defined environment variables that are spread over all services */
environment?: Maybe<Array<ConfigEnvironmentVariable>>;
environment?: Maybe<Array<ConfigGlobalEnvironmentVariable>>;
};
export type ConfigGlobalComparisonExp = {
_and?: InputMaybe<Array<ConfigGlobalComparisonExp>>;
_not?: InputMaybe<ConfigGlobalComparisonExp>;
_or?: InputMaybe<Array<ConfigGlobalComparisonExp>>;
environment?: InputMaybe<ConfigEnvironmentVariableComparisonExp>;
environment?: InputMaybe<ConfigGlobalEnvironmentVariableComparisonExp>;
};
export type ConfigGlobalEnvironmentVariable = {
__typename?: 'ConfigGlobalEnvironmentVariable';
name: Scalars['String'];
/** Value of the environment variable */
value: Scalars['String'];
};
export type ConfigGlobalEnvironmentVariableComparisonExp = {
_and?: InputMaybe<Array<ConfigGlobalEnvironmentVariableComparisonExp>>;
_not?: InputMaybe<ConfigGlobalEnvironmentVariableComparisonExp>;
_or?: InputMaybe<Array<ConfigGlobalEnvironmentVariableComparisonExp>>;
name?: InputMaybe<ConfigStringComparisonExp>;
value?: InputMaybe<ConfigStringComparisonExp>;
};
export type ConfigGlobalEnvironmentVariableInsertInput = {
name: Scalars['String'];
value: Scalars['String'];
};
export type ConfigGlobalEnvironmentVariableUpdateInput = {
name?: InputMaybe<Scalars['String']>;
value?: InputMaybe<Scalars['String']>;
};
export type ConfigGlobalInsertInput = {
environment?: InputMaybe<Array<ConfigEnvironmentVariableInsertInput>>;
environment?: InputMaybe<Array<ConfigGlobalEnvironmentVariableInsertInput>>;
};
export type ConfigGlobalUpdateInput = {
environment?: InputMaybe<Array<ConfigEnvironmentVariableUpdateInput>>;
environment?: InputMaybe<Array<ConfigGlobalEnvironmentVariableUpdateInput>>;
};
export type ConfigGrafana = {
@@ -1428,6 +1453,8 @@ export type ConfigHasuraSettings = {
enabledAPIs?: Maybe<Array<Scalars['ConfigHasuraAPIs']>>;
/** HASURA_GRAPHQL_LIVE_QUERIES_MULTIPLEXED_REFETCH_INTERVAL */
liveQueriesMultiplexedRefetchInterval?: Maybe<Scalars['ConfigUint32']>;
/** HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES */
stringifyNumericTypes?: Maybe<Scalars['Boolean']>;
};
export type ConfigHasuraSettingsComparisonExp = {
@@ -1441,6 +1468,7 @@ export type ConfigHasuraSettingsComparisonExp = {
enableRemoteSchemaPermissions?: InputMaybe<ConfigBooleanComparisonExp>;
enabledAPIs?: InputMaybe<ConfigHasuraApIsComparisonExp>;
liveQueriesMultiplexedRefetchInterval?: InputMaybe<ConfigUint32ComparisonExp>;
stringifyNumericTypes?: InputMaybe<ConfigBooleanComparisonExp>;
};
export type ConfigHasuraSettingsInsertInput = {
@@ -1451,6 +1479,7 @@ export type ConfigHasuraSettingsInsertInput = {
enableRemoteSchemaPermissions?: InputMaybe<Scalars['Boolean']>;
enabledAPIs?: InputMaybe<Array<Scalars['ConfigHasuraAPIs']>>;
liveQueriesMultiplexedRefetchInterval?: InputMaybe<Scalars['ConfigUint32']>;
stringifyNumericTypes?: InputMaybe<Scalars['Boolean']>;
};
export type ConfigHasuraSettingsUpdateInput = {
@@ -1461,6 +1490,7 @@ export type ConfigHasuraSettingsUpdateInput = {
enableRemoteSchemaPermissions?: InputMaybe<Scalars['Boolean']>;
enabledAPIs?: InputMaybe<Array<Scalars['ConfigHasuraAPIs']>>;
liveQueriesMultiplexedRefetchInterval?: InputMaybe<Scalars['ConfigUint32']>;
stringifyNumericTypes?: InputMaybe<Scalars['Boolean']>;
};
export type ConfigHasuraUpdateInput = {
@@ -2510,6 +2540,14 @@ export type Metrics = {
value: Scalars['float64'];
};
export type StatsDailyLiveFreeApps = {
__typename?: 'StatsDailyLiveFreeApps';
avg: Scalars['Int'];
max: Scalars['Int'];
min: Scalars['Int'];
raw: Array<Scalars['Int']>;
};
export type StatsLiveApps = {
__typename?: 'StatsLiveApps';
appID: Array<Scalars['uuid']>;
@@ -15821,6 +15859,12 @@ export type Query_Root = {
softwareVersions: Array<Software_Versions>;
/** fetch aggregated fields from the table: "software_versions" */
softwareVersionsAggregate: Software_Versions_Aggregate;
/**
* Returns the per-day number of free live apps in the given time range, as well as the min, max and avg.
*
* Requests that returned a 4xx or 5xx status code are not counted as live traffic.
*/
statsDailyLiveFreeApps: StatsDailyLiveFreeApps;
/**
* Returns lists of apps that have some live traffic in the give time range.
* From defaults to 24 hours ago and to defaults to now.
@@ -16878,6 +16922,12 @@ export type Query_RootSoftwareVersionsAggregateArgs = {
};
export type Query_RootStatsDailyLiveFreeAppsArgs = {
from?: InputMaybe<Scalars['Timestamp']>;
to?: InputMaybe<Scalars['Timestamp']>;
};
export type Query_RootStatsLiveAppsArgs = {
from?: InputMaybe<Scalars['Timestamp']>;
to?: InputMaybe<Scalars['Timestamp']>;
@@ -22439,6 +22489,11 @@ export type DeleteUserAccountMutationVariables = Exact<{
export type DeleteUserAccountMutation = { __typename?: 'mutation_root', deleteUser?: { __typename: 'users' } | null };
export type GetAuthUserProvidersQueryVariables = Exact<{ [key: string]: never; }>;
export type GetAuthUserProvidersQuery = { __typename?: 'query_root', authUserProviders: Array<{ __typename?: 'authUserProviders', id: any, providerId: string }> };
export type GetPersonalAccessTokensQueryVariables = Exact<{ [key: string]: never; }>;
@@ -22451,6 +22506,14 @@ export type DeletePersonalAccessTokenMutationVariables = Exact<{
export type DeletePersonalAccessTokenMutation = { __typename?: 'mutation_root', deletePersonalAccessToken?: { __typename?: 'authRefreshTokens', id: any, metadata?: any | null } | null };
export type UpdateUserDisplayNameMutationVariables = Exact<{
id: Scalars['uuid'];
displayName: Scalars['String'];
}>;
export type UpdateUserDisplayNameMutation = { __typename?: 'mutation_root', updateUser?: { __typename?: 'users', id: any, displayName: string } | null };
export type GetAiSettingsQueryVariables = Exact<{
appId: Scalars['uuid'];
}>;
@@ -22629,7 +22692,7 @@ export type DnsLookupCnameQueryVariables = Exact<{
export type DnsLookupCnameQuery = { __typename?: 'query_root', dnsLookupCNAME: string };
export type EnvironmentVariableFragment = { __typename?: 'ConfigEnvironmentVariable', name: string, value: string, id: string };
export type EnvironmentVariableFragment = { __typename?: 'ConfigGlobalEnvironmentVariable', name: string, value: string, id: string };
export type JwtSecretFragment = { __typename?: 'ConfigJWTSecret', issuer?: string | null, key?: string | null, type?: string | null, jwk_url?: any | null, header?: string | null, claims_namespace_path?: string | null, claims_namespace?: string | null, claims_format?: string | null, audience?: string | null, allowed_skew?: any | null };
@@ -22638,7 +22701,7 @@ export type GetEnvironmentVariablesQueryVariables = Exact<{
}>;
export type GetEnvironmentVariablesQuery = { __typename?: 'query_root', config?: { __typename: 'ConfigConfig', id: 'ConfigConfig', global?: { __typename?: 'ConfigGlobal', environment?: Array<{ __typename?: 'ConfigEnvironmentVariable', name: string, value: string, id: string }> | null } | null, hasura: { __typename?: 'ConfigHasura', adminSecret: string, webhookSecret: string, jwtSecrets?: Array<{ __typename?: 'ConfigJWTSecret', issuer?: string | null, key?: string | null, type?: string | null, jwk_url?: any | null, header?: string | null, claims_namespace_path?: string | null, claims_namespace?: string | null, claims_format?: string | null, audience?: string | null, allowed_skew?: any | null }> | null } } | null };
export type GetEnvironmentVariablesQuery = { __typename?: 'query_root', config?: { __typename: 'ConfigConfig', id: 'ConfigConfig', global?: { __typename?: 'ConfigGlobal', environment?: Array<{ __typename?: 'ConfigGlobalEnvironmentVariable', name: string, value: string, id: string }> | null } | null, hasura: { __typename?: 'ConfigHasura', adminSecret: string, webhookSecret: string, jwtSecrets?: Array<{ __typename?: 'ConfigJWTSecret', issuer?: string | null, key?: string | null, type?: string | null, jwk_url?: any | null, header?: string | null, claims_namespace_path?: string | null, claims_namespace?: string | null, claims_format?: string | null, audience?: string | null, allowed_skew?: any | null }> | null } } | null };
export type PermissionVariableFragment = { __typename?: 'ConfigAuthsessionaccessTokenCustomClaims', key: string, value: string, id: string };
@@ -23227,7 +23290,7 @@ export const PrefetchNewAppWorkspaceFragmentDoc = gql`
}
`;
export const EnvironmentVariableFragmentDoc = gql`
fragment EnvironmentVariable on ConfigEnvironmentVariable {
fragment EnvironmentVariable on ConfigGlobalEnvironmentVariable {
id: name
name
value
@@ -23484,6 +23547,44 @@ export function useDeleteUserAccountMutation(baseOptions?: Apollo.MutationHookOp
export type DeleteUserAccountMutationHookResult = ReturnType<typeof useDeleteUserAccountMutation>;
export type DeleteUserAccountMutationResult = Apollo.MutationResult<DeleteUserAccountMutation>;
export type DeleteUserAccountMutationOptions = Apollo.BaseMutationOptions<DeleteUserAccountMutation, DeleteUserAccountMutationVariables>;
export const GetAuthUserProvidersDocument = gql`
query getAuthUserProviders {
authUserProviders {
id
providerId
}
}
`;
/**
* __useGetAuthUserProvidersQuery__
*
* To run a query within a React component, call `useGetAuthUserProvidersQuery` and pass it any options that fit your needs.
* When your component renders, `useGetAuthUserProvidersQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useGetAuthUserProvidersQuery({
* variables: {
* },
* });
*/
export function useGetAuthUserProvidersQuery(baseOptions?: Apollo.QueryHookOptions<GetAuthUserProvidersQuery, GetAuthUserProvidersQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<GetAuthUserProvidersQuery, GetAuthUserProvidersQueryVariables>(GetAuthUserProvidersDocument, options);
}
export function useGetAuthUserProvidersLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetAuthUserProvidersQuery, GetAuthUserProvidersQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<GetAuthUserProvidersQuery, GetAuthUserProvidersQueryVariables>(GetAuthUserProvidersDocument, options);
}
export type GetAuthUserProvidersQueryHookResult = ReturnType<typeof useGetAuthUserProvidersQuery>;
export type GetAuthUserProvidersLazyQueryHookResult = ReturnType<typeof useGetAuthUserProvidersLazyQuery>;
export type GetAuthUserProvidersQueryResult = Apollo.QueryResult<GetAuthUserProvidersQuery, GetAuthUserProvidersQueryVariables>;
export function refetchGetAuthUserProvidersQuery(variables?: GetAuthUserProvidersQueryVariables) {
return { query: GetAuthUserProvidersDocument, variables: variables }
}
export const GetPersonalAccessTokensDocument = gql`
query GetPersonalAccessTokens {
personalAccessTokens: authRefreshTokens(
@@ -23561,6 +23662,41 @@ export function useDeletePersonalAccessTokenMutation(baseOptions?: Apollo.Mutati
export type DeletePersonalAccessTokenMutationHookResult = ReturnType<typeof useDeletePersonalAccessTokenMutation>;
export type DeletePersonalAccessTokenMutationResult = Apollo.MutationResult<DeletePersonalAccessTokenMutation>;
export type DeletePersonalAccessTokenMutationOptions = Apollo.BaseMutationOptions<DeletePersonalAccessTokenMutation, DeletePersonalAccessTokenMutationVariables>;
export const UpdateUserDisplayNameDocument = gql`
mutation updateUserDisplayName($id: uuid!, $displayName: String!) {
updateUser(pk_columns: {id: $id}, _set: {displayName: $displayName}) {
id
displayName
}
}
`;
export type UpdateUserDisplayNameMutationFn = Apollo.MutationFunction<UpdateUserDisplayNameMutation, UpdateUserDisplayNameMutationVariables>;
/**
* __useUpdateUserDisplayNameMutation__
*
* To run a mutation, you first call `useUpdateUserDisplayNameMutation` within a React component and pass it any options that fit your needs.
* When your component renders, `useUpdateUserDisplayNameMutation` returns a tuple that includes:
* - A mutate function that you can call at any time to execute the mutation
* - An object with fields that represent the current status of the mutation's execution
*
* @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
*
* @example
* const [updateUserDisplayNameMutation, { data, loading, error }] = useUpdateUserDisplayNameMutation({
* variables: {
* id: // value for 'id'
* displayName: // value for 'displayName'
* },
* });
*/
export function useUpdateUserDisplayNameMutation(baseOptions?: Apollo.MutationHookOptions<UpdateUserDisplayNameMutation, UpdateUserDisplayNameMutationVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useMutation<UpdateUserDisplayNameMutation, UpdateUserDisplayNameMutationVariables>(UpdateUserDisplayNameDocument, options);
}
export type UpdateUserDisplayNameMutationHookResult = ReturnType<typeof useUpdateUserDisplayNameMutation>;
export type UpdateUserDisplayNameMutationResult = Apollo.MutationResult<UpdateUserDisplayNameMutation>;
export type UpdateUserDisplayNameMutationOptions = Apollo.BaseMutationOptions<UpdateUserDisplayNameMutation, UpdateUserDisplayNameMutationVariables>;
export const GetAiSettingsDocument = gql`
query GetAISettings($appId: uuid!) {
config(appID: $appId, resolve: false) {

View File

@@ -3,18 +3,14 @@ import {
getFunctionsServiceUrl,
getGraphqlServiceUrl,
getStorageServiceUrl,
isPlatform,
} from '@/utils/env';
import { NhostClient } from '@nhost/nextjs';
// eslint-disable-next-line no-nested-ternary
const nhost = isPlatform()
? new NhostClient({
authUrl: getAuthServiceUrl(),
graphqlUrl: getGraphqlServiceUrl(),
functionsUrl: getFunctionsServiceUrl(),
storageUrl: getStorageServiceUrl(),
})
: new NhostClient({ subdomain: 'local' });
const nhost = new NhostClient({
authUrl: getAuthServiceUrl(),
graphqlUrl: getGraphqlServiceUrl(),
functionsUrl: getFunctionsServiceUrl(),
storageUrl: getStorageServiceUrl(),
});
export default nhost;

View File

@@ -1,5 +1,38 @@
# @nhost/docs
## 2.9.0
### Minor Changes
- 3c31657: chore: update docs with provider connect
### Patch Changes
- 992939c: feat: added social connect docs
## 2.8.0
### Minor Changes
- 768ca17: chore: update dependencies
### Patch Changes
- 9f2bf9e: chore: added hasura's authHook settings
## 2.7.2
### Patch Changes
- 5c47e8e: feat: added hasura's stringifyNumericTypes setting
## 2.7.1
### Patch Changes
- 6cb2b63: feat: added nhost run env documentation
- 40bd3e4: fix: fixed wrong links in documentation
## 2.7.0
### Minor Changes

View File

@@ -44,8 +44,22 @@ Below, you will find the official `CUE` schema and an example on how to configur
// HASURA_GRAPHQL_LIVE_QUERIES_MULTIPLEXED_REFETCH_INTERVAL
liveQueriesMultiplexedRefetchInterval: uint32 | *1000
// HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES
stringifyNumericTypes: bool | *false
}
authHook?: {
// HASURA_GRAPHQL_AUTH_HOOK
url: string
// HASURA_GRAPHQL_AUTH_HOOK_MODE
mode: "GET"|*"POST"
// HASURA_GRAPHQL_AUTH_HOOK_SEND_REQUEST_BODY
sendRequestBody: bool | *true
}
logs: {
// HASURA_GRAPHQL_LOG_LEVEL
level: "debug" | "info" | "error" | *"warn"
@@ -83,6 +97,7 @@ enableConsole = true
enableRemoteSchemaPermissions = true
enabledAPIs = ['metadata']
liveQueriesMultiplexedRefetchInterval = 1000
stringifyNumericTypes = false
[hasura.logs]
level = 'warn'

View File

@@ -86,4 +86,4 @@ await nhost.auth.sendVerificationEmail(
</Tab>
</Tabs>
<Tip>It is possible to customize these automatic emails, learn how to [here](/authentication/templates)</Tip>
<Tip>It is possible to customize these automatic emails, learn how to [here](/guides/auth/email-templates)</Tip>

View File

@@ -34,5 +34,5 @@ await nhost.auth.signIn(
<Tip>Users who have signed up with email and password can also sign in with a Magic Link</Tip>
<Tip>It is possible to customize the email with the Magic Link, learn how to [here](/authentication/templates)</Tip>
<Tip>It is possible to customize the email with the Magic Link, learn how to [here](/guides/auth/email-templates)</Tip>

View File

@@ -0,0 +1,43 @@
---
title: Social Provider Connect
sidebarTitle: Social Provider Connect
description: Add social sign in mechanism to existing users
icon: link
---
With the social provider connect feature, users can link their social authentication method to their account, regardless of the initial sign-up method. It enables users to link different social authentication providers to their accounts, even if the email addresses do not match (e.g., linking a GitHub profile to an account registered with a different email). This feature offers flexibility, allowing users to streamline their login process by connecting multiple authentication methods.
To add a social authentication method to an existing user you need to call the url `https://${subdomain}.auth.${region}.nhost.run/v1/signin/provider/${provider}?connect=${jwt}`. This is very easy to achieve with our SDK:
``` js
nhost.auth.connectProvider({
provider: 'github'
})
```
In addition, hooks for react, vue and other frameworks may be provided. Check our [reference](/reference/overview#client-libraries) documentation for more details.
<Note>
Keep in mind that as we need a `JWT` the user needs to be logged in.
</Note>
## Viewing and Deleting Social Provider Authentication Mechanisms
If you want to allow your users to view and/or delete social provider authentication mechanisms, you can provide the necessary permissions to the table `auth.user_providers` (i.e. `select` and/or `delete`) and then use the appropriate GraphQL query. For example, the following permissions should allow users to list their own social providers:
![social connect permissions](/images/guides/auth/social-connect-permissions.png)
Using the following GraphQL query:
``` js
const { error, data } = await nhost.graphql.request(
gql`
query getAuthUserProviders {
authUserProviders {
id
providerId
}
}
`,
)
```

View File

@@ -19,7 +19,7 @@ You're allowed to:
## Roles
Each user has one **default role** and a list of **allowed roles**. These roles are used to resolve permissions for requests to [GraphQL](/graphql/permissions) and [Storage](/storage#permissions).
Each user has one **default role** and a list of **allowed roles**. These roles are used to resolve permissions for requests to [GraphQL](/guides/api/permissions) and [Storage](/guides/storage/overview#permissions).
When the user makes a request, only one role is used to resolve permissions. The default role is used if no role is explicitly specified. Users can only make requests using the default role or one of the allowed roles.

View File

@@ -24,3 +24,65 @@ Based on the information above, if you want to connect directly to your service
<Note>You can also use the environment variable `NHOST_RUN_SERVICE` passing comma-separated values. For instance, the equivalent environment variable for this example would be `NHOST_RUN_SERVICE=../mysvc/nhost-run-service.toml:mysvc,../mysvc/nhost-run-service.toml`</Note>
<Warning>The Nhost CLI doesn't build services so make sure you build any image that might be needed for running `nhost run --run-service...`</Warning>
# Quick Development
While developing your service, you may want to run it locally outside of the Nhost CLI to quickly iterate on it. To simplify this the Nhost CLI includes a command to generate an `.env` file based on your environment variables configuration and secrets. For instance, imagine a service with the following configuration:
<Tabs>
<Tab title="run-service.toml">
```toml
[[environment]]
name = 'HASURA_GRAPHQL_URL'
value = 'http://hasura-service:8080/v1/graphql'
[[environment]]
name = 'SOME_CONFIGURATION_PARAMETER'
value = 'some-value'
[[environment]]
name = 'SECRET_KEY'
value = '{{ secrets.SECRET_KEY }}'
```
</Tab>
<Tab title="overlay">
```json
[
{
"value": {
"name": "ENVIRONMENT",
"value": "dev"
},
"op": "add",
"path": "/environment/-"
},
{
"value": "https://local.graphql.nhost.run/v1/graphql",
"op": "replace",
"path": "/environment/0/value"
}
]
```
</Tab>
<Tab title=".secrets">
```toml
SECRET_KEY = '#asdasd;l;kq23\\n40-0as9d"$\\'
```
</Tab>
</Tabs>
We can then generate an `env` file for our service with the folllowing command:
```
$ nhost run env --config ../mysvc/nhost-run-service.toml --overlay-name local-dev > .env
$ cat .env
HASURA_GRAPHQL_URL="https://local.graphql.nhost.run/v1/graphql"
SOME_CONFIGURATION_PARAMETER="some-value"
SECRET_KEY="#asdasd;l;kq23\\n40-0as9d\"\$\\"
ENVIRONMENT="dev"
```
<Warning>
Keep in mind you may need to use different configuration when attempting to connect to other services in the stack. For instance, in the example above we are using `http://hasura-service:8080/v1/graphql` to connect to hasura in production and in the CLI but when running the service in the host machine using the env file we are using an overlay to change the value to `https://local.graphql.nhost.run/v1/graphql`. Refer to the [network](networking) configuration for more details.
</Warning>

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 KiB

View File

@@ -128,6 +128,7 @@
"guides/auth/social/sign-in-workos"
]
},
"guides/auth/social-connect",
"guides/auth/sign-in-email-password",
"guides/auth/sign-in-magic-link",
"guides/auth/sign-in-phone-number",
@@ -197,7 +198,7 @@
"reference/auth/verfiy-fido2-webauthn-authentication-and-complete-signup",
"reference/auth/sign-in-using-email-via-fido2-webauthn-authentication",
"reference/auth/verfiy-fido2-webauthn-authentication-using-public-key-cryptography",
"reference/auth/elevate-webauthn",
"reference/auth/elevate-webauthn",
"reference/auth/elevate-webauthn-verify"
]
},
@@ -319,7 +320,8 @@
"reference/javascript/auth/sign-out",
"reference/javascript/auth/sign-up",
"reference/javascript/auth/add-security-key",
"reference/javascript/auth/elevate-email-security-key"
"reference/javascript/auth/elevate-email-security-key",
"reference/javascript/auth/connect-provider"
]
},
{

View File

@@ -1,11 +1,11 @@
{
"name": "@nhost/docs",
"version": "2.7.0",
"version": "2.9.0",
"private": true,
"scripts": {
"start": "mintlify dev"
},
"devDependencies": {
"mintlify": "^4.0.128"
"mintlify": "^4.0.136"
}
}

View File

@@ -1,16 +0,0 @@
---
title: activateMfaPromise()
sidebarTitle: activateMfaPromise()
---
## Parameters
---
**<span className="parameter-name">service</span>** <span className="optional-status">required</span> <code>Interpreter&lt;EnableMfaContext, any, &#123; type: "GENERATE" &#125; &#124; &#123; type: "ACTIVATE", code: string, activeMfaType: "totp" &#125; &#124; &#123; type: "GENERATED" &#125; &#124; &#123; type: "GENERATED_ERROR", error: null &#124; AuthErrorPayload &#125; &#124; &#123; type: "SUCCESS" &#125; &#124; &#123; type: "ERROR", error: null &#124; AuthErrorPayload &#125;, &#123; value: any, context: EnableMfaContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "GENERATE" &#125; &#124; &#123; type: "ACTIVATE", code: string, activeMfaType: "totp" &#125; &#124; &#123; type: "GENERATED" &#125; &#124; &#123; type: "GENERATED_ERROR", error: null &#124; AuthErrorPayload &#125; &#124; &#123; type: "SUCCESS" &#125; &#124; &#123; type: "ERROR", error: null &#124; AuthErrorPayload &#125;, BaseActionObject, ServiceMap&gt;&gt;</code>
---
**<span className="parameter-name">code</span>** <span className="optional-status">required</span> <code>string</code>
---

View File

@@ -1,16 +0,0 @@
---
title: addSecurityKeyPromise()
sidebarTitle: addSecurityKeyPromise()
---
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---
**<span className="parameter-name">nickname</span>** <span className="optional-status">optional</span> <code>string</code>
---

View File

@@ -1,24 +0,0 @@
---
title: changeEmailPromise()
sidebarTitle: changeEmailPromise()
---
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;ChangeEmailContext, any, &#123; type: "REQUEST", email: string, options: ChangeEmailOptions &#125; &#124; &#123; type: "SUCCESS" &#125; &#124; &#123; type: "ERROR", error: null &#124; AuthErrorPayload &#125;, &#123; value: any, context: ChangeEmailContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "REQUEST", email: string, options: ChangeEmailOptions &#125; &#124; &#123; type: "SUCCESS" &#125; &#124; &#123; type: "ERROR", error: null &#124; AuthErrorPayload &#125;, BaseActionObject, ChangeEmailServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`ChangeEmailOptions`](/reference/javascript/auth/types/change-email-options)
| Property | Type | Required | Notes |
| :--------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
---

View File

@@ -1,20 +0,0 @@
---
title: changePasswordPromise()
sidebarTitle: changePasswordPromise()
---
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;ChangePasswordContext, any, &#123; type: "REQUEST", password: string, ticket: string &#125; &#124; &#123; type: "SUCCESS" &#125; &#124; &#123; type: "ERROR", error: null &#124; AuthErrorPayload &#125;, &#123; value: any, context: ChangePasswordContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "REQUEST", password: string, ticket: string &#125; &#124; &#123; type: "SUCCESS" &#125; &#124; &#123; type: "ERROR", error: null &#124; AuthErrorPayload &#125;, BaseActionObject, ChangePasswordServices&gt;&gt;</code>
---
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">ticket</span>** <span className="optional-status">optional</span> <code>string</code>
---

View File

@@ -1,23 +0,0 @@
---
title: createAuthMachine()
sidebarTitle: createAuthMachine()
---
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`AuthMachineOptions`](/reference/javascript/auth/types/auth-machine-options)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientUrl</span> | <code>string</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>backendUrl</span> | <code>string</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>devTools</span> | <code>boolean</code> | | Activate devTools e.g. the ability to connect to the xstate inspector |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoSignIn</span> | <code>boolean</code> | | When set to true, will parse the url on startup to check if it contains a refresh token to start the session with |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>autoRefreshToken</span> | <code>boolean</code> | | When set to true, will automatically refresh token before it expires |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorage</span> | [`ClientStorage`](/reference/javascript/auth/types/client-storage) | | Object where the refresh token will be persisted and read locally. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>clientStorageType</span> | [`ClientStorageType`](/reference/javascript/auth/types/client-storage-type) | | Define a way to get information about the refresh token and its exipration date. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>refreshIntervalTime</span> | <code>number</code> | | Time interval until token refreshes, in seconds |
---

View File

@@ -1,12 +0,0 @@
---
title: createChangeEmailMachine()
sidebarTitle: createChangeEmailMachine()
---
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---

View File

@@ -1,12 +0,0 @@
---
title: createChangePasswordMachine()
sidebarTitle: createChangePasswordMachine()
---
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---

View File

@@ -1,12 +0,0 @@
---
title: createEnableMfaMachine()
sidebarTitle: createEnableMfaMachine()
---
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---

View File

@@ -1,12 +0,0 @@
---
title: createResetPasswordMachine()
sidebarTitle: createResetPasswordMachine()
---
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---

View File

@@ -1,12 +0,0 @@
---
title: createSendVerificationEmailMachine()
sidebarTitle: createSendVerificationEmailMachine()
---
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> <code>AuthClient</code>
---

View File

@@ -1,16 +0,0 @@
---
title: encodeQueryParameters()
sidebarTitle: encodeQueryParameters()
---
## Parameters
---
**<span className="parameter-name">baseUrl</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">parameters</span>** <span className="optional-status">optional</span> <code>Record&lt;string, unknown&gt;</code>
---

View File

@@ -1,12 +0,0 @@
---
title: generateQrCodePromise()
sidebarTitle: generateQrCodePromise()
---
## Parameters
---
**<span className="parameter-name">service</span>** <span className="optional-status">required</span> <code>Interpreter&lt;EnableMfaContext, any, &#123; type: "GENERATE" &#125; &#124; &#123; type: "ACTIVATE", code: string, activeMfaType: "totp" &#125; &#124; &#123; type: "GENERATED" &#125; &#124; &#123; type: "GENERATED_ERROR", error: null &#124; AuthErrorPayload &#125; &#124; &#123; type: "SUCCESS" &#125; &#124; &#123; type: "ERROR", error: null &#124; AuthErrorPayload &#125;, &#123; value: any, context: EnableMfaContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "GENERATE" &#125; &#124; &#123; type: "ACTIVATE", code: string, activeMfaType: "totp" &#125; &#124; &#123; type: "GENERATED" &#125; &#124; &#123; type: "GENERATED_ERROR", error: null &#124; AuthErrorPayload &#125; &#124; &#123; type: "SUCCESS" &#125; &#124; &#123; type: "ERROR", error: null &#124; AuthErrorPayload &#125;, BaseActionObject, ServiceMap&gt;&gt;</code>
---

View File

@@ -1,21 +0,0 @@
---
title: getAuthenticationResult()
sidebarTitle: getAuthenticationResult()
---
## Parameters
---
**<span className="parameter-name">\_\_namedParameters</span>** <span className="optional-status">required</span> [`SessionActionHandlerResult`](/reference/javascript/auth/types/session-action-handler-result)
| Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------- | :------: | :------------------------------------------ |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>refreshToken</span> | <code>null &#124; string</code> | ✔️ | Access token (JWT) |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>accessToken</span> | <code>null &#124; string</code> | ✔️ | Access token (JWT) |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>user</span> | <code>null &#124; [`User`](/reference/javascript/auth/types/user)</code> | ✔️ | User information |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>isSuccess</span> | <code>boolean</code> | ✔️ | Returns `true` if the action is successful. |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>error</span> | <code>null &#124; [`AuthErrorPayload`](/reference/javascript/auth/types/auth-error-payload)</code> | ✔️ | Provides details about the error |
| <span className="parameter-name"><span className="light-grey">\_\_namedParameters.</span>isError</span> | <code>boolean</code> | ✔️ | |
---

View File

@@ -1,16 +0,0 @@
---
title: getFetch()
sidebarTitle: getFetch()
---
## Parameters
---
**<span className="parameter-name">url</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">token</span>** <span className="optional-status">optional</span> <code>null &#124; string</code>
---

View File

@@ -1,16 +0,0 @@
---
title: getParameterByName()
sidebarTitle: getParameterByName()
---
## Parameters
---
**<span className="parameter-name">name</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">url</span>** <span className="optional-status">optional</span> <code>string</code>
---

View File

@@ -1,22 +0,0 @@
---
title: getSession()
sidebarTitle: getSession()
---
## Parameters
---
**<span className="parameter-name">context</span>** <span className="optional-status">optional</span> [`AuthContext`](/reference/javascript/auth/types/auth-context)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------- | :------: | :------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">context.</span>errors</span> | <code>Partial&lt;Record&lt;StateErrorTypes, AuthErrorPayload&gt;&gt;</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>importTokenAttempts</span> | <code>number</code> | ✔️ | Number of times the user tried to get an access token from a refresh token but got a network error |
| <span className="parameter-name"><span className="light-grey">context.</span>refreshToken</span> | <code>&#123; value: string &#124; null, isPAT: boolean &#125;</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>refreshTimer</span> | <code>&#123; startedAt: Date &#124; null, attempts: number, lastAttempt: Date &#124; null &#125;</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>accessToken</span> | <code>&#123; value: string &#124; null, expiresAt: Date &#124; null, expiresInSeconds: number &#124; null &#125;</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>mfa</span> | <code>&#123; ticket: string &#125; &#124; null</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>user</span> | <code>[`User`](/reference/javascript/auth/types/user) &#124; null</code> | ✔️ | |
---

View File

@@ -1,4 +0,0 @@
---
title: isBrowser()
sidebarTitle: isBrowser()
---

View File

@@ -1,12 +0,0 @@
---
title: isValidEmail()
sidebarTitle: isValidEmail()
---
## Parameters
---
**<span className="parameter-name">email</span>** <span className="optional-status">optional</span> <code>null &#124; string</code>
---

View File

@@ -1,12 +0,0 @@
---
title: isValidPassword()
sidebarTitle: isValidPassword()
---
## Parameters
---
**<span className="parameter-name">password</span>** <span className="optional-status">optional</span> <code>null &#124; string</code>
---

View File

@@ -1,12 +0,0 @@
---
title: isValidPhoneNumber()
sidebarTitle: isValidPhoneNumber()
---
## Parameters
---
**<span className="parameter-name">phoneNumber</span>** <span className="optional-status">optional</span> <code>null &#124; string</code>
---

View File

@@ -1,12 +0,0 @@
---
title: isValidTicket()
sidebarTitle: isValidTicket()
---
## Parameters
---
**<span className="parameter-name">ticket</span>** <span className="optional-status">optional</span> <code>null &#124; string</code>
---

View File

@@ -1,30 +0,0 @@
---
title: localStorageGetter()
sidebarTitle: localStorageGetter()
---
## Parameters
---
**<span className="parameter-name">clientStorageType</span>** <span className="optional-status">required</span> [`ClientStorageType`](/reference/javascript/auth/types/client-storage-type)
---
**<span className="parameter-name">clientStorage</span>** <span className="optional-status">optional</span> [`ClientStorage`](/reference/javascript/auth/types/client-storage)
| Property | Type | Required | Notes |
| :-------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customSet</span> | <code>(key: string, value: null &#124; string) =&gt; void &#124; Promise&lt;void&gt;</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customGet</span> | <code>(key: string) =&gt; null &#124; string &#124; Promise&lt;null &#124; string&gt;</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>deleteItemAsync</span> | <code>(key: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItemAsync</span> | <code>(key: string) =&gt; any</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItemAsync</span> | <code>(key: string, value: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>remove</span> | <code>(options: &#123; key: string &#125;) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>get</span> | <code>(options: &#123; key: string &#125;) =&gt; any</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>set</span> | <code>(options: &#123; key: string, value: string &#125;) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>removeItem</span> | <code>(key: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItem</span> | <code>(key: string) =&gt; any</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItem</span> | <code>(\_key: string, \_value: string) =&gt; void</code> | | |
---

View File

@@ -1,30 +0,0 @@
---
title: localStorageSetter()
sidebarTitle: localStorageSetter()
---
## Parameters
---
**<span className="parameter-name">clientStorageType</span>** <span className="optional-status">required</span> [`ClientStorageType`](/reference/javascript/auth/types/client-storage-type)
---
**<span className="parameter-name">clientStorage</span>** <span className="optional-status">optional</span> [`ClientStorage`](/reference/javascript/auth/types/client-storage)
| Property | Type | Required | Notes |
| :-------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItem</span> | <code>(\_key: string, \_value: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItem</span> | <code>(key: string) =&gt; any</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>removeItem</span> | <code>(key: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>set</span> | <code>(options: &#123; key: string, value: string &#125;) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>get</span> | <code>(options: &#123; key: string &#125;) =&gt; any</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>remove</span> | <code>(options: &#123; key: string &#125;) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>setItemAsync</span> | <code>(key: string, value: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>getItemAsync</span> | <code>(key: string) =&gt; any</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>deleteItemAsync</span> | <code>(key: string) =&gt; void</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customGet</span> | <code>(key: string) =&gt; null &#124; string &#124; Promise&lt;null &#124; string&gt;</code> | | |
| <span className="parameter-name"><span className="light-grey">clientStorage.</span>customSet</span> | <code>(key: string, value: null &#124; string) =&gt; void &#124; Promise&lt;void&gt;</code> | | |
---

View File

@@ -1,20 +0,0 @@
---
title: postFetch()
sidebarTitle: postFetch()
---
## Parameters
---
**<span className="parameter-name">url</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">body</span>** <span className="optional-status">required</span> <code>any</code>
---
**<span className="parameter-name">token</span>** <span className="optional-status">optional</span> <code>null &#124; string</code>
---

View File

@@ -1,12 +0,0 @@
---
title: removeParameterFromWindow()
sidebarTitle: removeParameterFromWindow()
---
## Parameters
---
**<span className="parameter-name">name</span>** <span className="optional-status">required</span> <code>string</code>
---

View File

@@ -1,24 +0,0 @@
---
title: resetPasswordPromise()
sidebarTitle: resetPasswordPromise()
---
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;ResetPasswordContext, any, &#123; type: "REQUEST", email: string, options: ResetPasswordOptions &#125; &#124; &#123; type: "SUCCESS" &#125; &#124; &#123; type: "ERROR", error: null &#124; AuthErrorPayload &#125;, &#123; value: any, context: ResetPasswordContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "REQUEST", email: string, options: ResetPasswordOptions &#125; &#124; &#123; type: "SUCCESS" &#125; &#124; &#123; type: "ERROR", error: null &#124; AuthErrorPayload &#125;, BaseActionObject, ResetPasswordServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`ResetPasswordOptions`](/reference/javascript/auth/types/reset-password-options)
| Property | Type | Required | Notes |
| :--------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
---

View File

@@ -1,25 +0,0 @@
---
title: rewriteRedirectTo()
sidebarTitle: rewriteRedirectTo()
---
Transform options that include a redirectTo property so the
redirect url is absolute, given a base clientUrl.
If no client url is given, any relative redirectUrl is removed while
the other options are sent as-is.
**`@returns`**
## Parameters
---
**<span className="parameter-name">clientUrl</span>** <span className="optional-status">optional</span> <code>string</code>
base client url
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> <code>T</code>
---

View File

@@ -1,24 +0,0 @@
---
title: sendVerificationEmailPromise()
sidebarTitle: sendVerificationEmailPromise()
---
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;SendVerificationEmailContext, any, &#123; type: "REQUEST", email: string, options: SendVerificationEmailOptions &#125; &#124; &#123; type: "SUCCESS" &#125; &#124; &#123; type: "ERROR", error: null &#124; AuthErrorPayload &#125;, &#123; value: any, context: SendVerificationEmailContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "REQUEST", email: string, options: SendVerificationEmailOptions &#125; &#124; &#123; type: "SUCCESS" &#125; &#124; &#123; type: "ERROR", error: null &#124; AuthErrorPayload &#125;, BaseActionObject, SendVerificationEmailServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`SendVerificationEmailOptions`](/reference/javascript/auth/types/send-verification-email-options)
| Property | Type | Required | Notes |
| :--------------------------------------------------------------------------------------------- | :------------------ | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
---

View File

@@ -1,12 +0,0 @@
---
title: signInAnonymousPromise()
sidebarTitle: signInAnonymousPromise()
---
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, &#123; value: any, context: AuthContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, BaseActionObject, AuthServices&gt;&gt;</code>
---

View File

@@ -1,20 +0,0 @@
---
title: signInEmailPasswordPromise()
sidebarTitle: signInEmailPasswordPromise()
---
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, &#123; value: any, context: AuthContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> <code>string</code>
---

View File

@@ -1,29 +0,0 @@
---
title: signInEmailPasswordlessPromise()
sidebarTitle: signInEmailPasswordlessPromise()
---
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, &#123; value: any, context: AuthContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`PasswordlessOptions`](/reference/javascript/auth/types/passwordless-options)
| Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------------- | :----------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
| <span className="parameter-name"><span className="light-grey">options.</span>metadata</span> | <code>Record&lt;string, unknown&gt;</code> | | Custom additional user information stored in the `metadata` column. Can be any JSON object. |
| <span className="parameter-name"><span className="light-grey">options.</span>displayName</span> | <code>string</code> | | Display name of the user. If not provided, it will use the display name given by the social provider (Oauth) used on registration, or the email address otherwise. |
| <span className="parameter-name"><span className="light-grey">options.</span>defaultRole</span> | <code>string</code> | | Default role of the user. Must be part of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>allowedRoles</span> | <code>Array&lt;string&gt;</code> | | Allowed roles of the user. Must be a subset of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>locale</span> | <code>string</code> | | Locale of the user, in two digits |
---

View File

@@ -1,16 +0,0 @@
---
title: signInEmailSecurityKeyPromise()
sidebarTitle: signInEmailSecurityKeyPromise()
---
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, &#123; value: any, context: AuthContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---

View File

@@ -1,20 +0,0 @@
---
title: signInMfaTotpPromise()
sidebarTitle: signInMfaTotpPromise()
---
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, &#123; value: any, context: AuthContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">otp</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">ticket</span>** <span className="optional-status">optional</span> <code>string</code>
---

View File

@@ -1,16 +0,0 @@
---
title: signInPATPromise()
sidebarTitle: signInPATPromise()
---
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, &#123; value: any, context: AuthContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">pat</span>** <span className="optional-status">required</span> <code>string</code>
---

View File

@@ -1,20 +0,0 @@
---
title: signInSmsPasswordlessOtpPromise()
sidebarTitle: signInSmsPasswordlessOtpPromise()
---
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, &#123; value: any, context: AuthContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">phoneNumber</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">otp</span>** <span className="optional-status">required</span> <code>string</code>
---

View File

@@ -1,29 +0,0 @@
---
title: signInSmsPasswordlessPromise()
sidebarTitle: signInSmsPasswordlessPromise()
---
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, &#123; value: any, context: AuthContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">phoneNumber</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`PasswordlessOptions`](/reference/javascript/auth/types/passwordless-options)
| Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------------- | :----------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">options.</span>locale</span> | <code>string</code> | | Locale of the user, in two digits |
| <span className="parameter-name"><span className="light-grey">options.</span>allowedRoles</span> | <code>Array&lt;string&gt;</code> | | Allowed roles of the user. Must be a subset of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>defaultRole</span> | <code>string</code> | | Default role of the user. Must be part of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>displayName</span> | <code>string</code> | | Display name of the user. If not provided, it will use the display name given by the social provider (Oauth) used on registration, or the email address otherwise. |
| <span className="parameter-name"><span className="light-grey">options.</span>metadata</span> | <code>Record&lt;string, unknown&gt;</code> | | Custom additional user information stored in the `metadata` column. Can be any JSON object. |
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
---

View File

@@ -1,16 +0,0 @@
---
title: signOutPromise()
sidebarTitle: signOutPromise()
---
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, &#123; value: any, context: AuthContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">all</span>** <span className="optional-status">optional</span> <code>boolean</code>
---

View File

@@ -1,33 +0,0 @@
---
title: signUpEmailPasswordPromise()
sidebarTitle: signUpEmailPasswordPromise()
---
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, &#123; value: any, context: AuthContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">password</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`SignUpOptions`](/reference/javascript/auth/types/sign-up-options)
| Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------------- | :----------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
| <span className="parameter-name"><span className="light-grey">options.</span>metadata</span> | <code>Record&lt;string, unknown&gt;</code> | | Custom additional user information stored in the `metadata` column. Can be any JSON object. |
| <span className="parameter-name"><span className="light-grey">options.</span>displayName</span> | <code>string</code> | | Display name of the user. If not provided, it will use the display name given by the social provider (Oauth) used on registration, or the email address otherwise. |
| <span className="parameter-name"><span className="light-grey">options.</span>defaultRole</span> | <code>string</code> | | Default role of the user. Must be part of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>allowedRoles</span> | <code>Array&lt;string&gt;</code> | | Allowed roles of the user. Must be a subset of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>locale</span> | <code>string</code> | | Locale of the user, in two digits |
---

View File

@@ -1,30 +0,0 @@
---
title: signUpEmailSecurityKeyPromise()
sidebarTitle: signUpEmailSecurityKeyPromise()
---
## Parameters
---
**<span className="parameter-name">interpreter</span>** <span className="optional-status">required</span> <code>Interpreter&lt;AuthContext, any, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, &#123; value: any, context: AuthContext &#125;, ResolveTypegenMeta&lt;Typegen0, &#123; type: "SESSION_UPDATE", data: &#123; session: NhostSession &#125; &#125; &#124; &#123; type: "TRY_TOKEN", token: string &#125; &#124; &#123; type: "SIGNIN_ANONYMOUS" &#125; &#124; &#123; type: "SIGNIN_PAT", pat: string &#125; &#124; &#123; type: "SIGNIN_SECURITY_KEY_EMAIL", email: string &#125; &#124; &#123; type: "SIGNIN_PASSWORD", email: string, password: string &#125; &#124; &#123; type: "PASSWORDLESS_EMAIL", email: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS", phoneNumber: string, options: PasswordlessOptions &#125; &#124; &#123; type: "PASSWORDLESS_SMS_OTP", phoneNumber: string, otp: string &#125; &#124; &#123; type: "SIGNUP_EMAIL_PASSWORD", email: string, password: string, options: SignUpOptions &#125; &#124; &#123; type: "SIGNUP_SECURITY_KEY", email: string, options: SignUpSecurityKeyOptions &#125; &#124; &#123; type: "SIGNOUT", all: boolean &#125; &#124; &#123; type: "SIGNIN_MFA_TOTP", ticket: string, otp: string &#125; &#124; &#123; type: "SIGNED_IN" &#125; &#124; &#123; type: "SIGNED_OUT" &#125; &#124; &#123; type: "TOKEN_CHANGED" &#125; &#124; &#123; type: "AWAIT_EMAIL_VERIFICATION" &#125;, BaseActionObject, AuthServices&gt;&gt;</code>
---
**<span className="parameter-name">email</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">options</span>** <span className="optional-status">optional</span> [`SignUpSecurityKeyOptions`](/reference/javascript/auth/types/sign-up-security-key-options)
| Property | Type | Required | Notes |
| :----------------------------------------------------------------------------------------------- | :----------------------------------------- | :------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">options.</span>nickname</span> | <code>string</code> | | Optional nickname for the security key |
| <span className="parameter-name"><span className="light-grey">options.</span>redirectTo</span> | <code>string</code> | | Redirection path in the client application that will be used in the link in the verification email. For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`. |
| <span className="parameter-name"><span className="light-grey">options.</span>metadata</span> | <code>Record&lt;string, unknown&gt;</code> | | Custom additional user information stored in the `metadata` column. Can be any JSON object. |
| <span className="parameter-name"><span className="light-grey">options.</span>displayName</span> | <code>string</code> | | Display name of the user. If not provided, it will use the display name given by the social provider (Oauth) used on registration, or the email address otherwise. |
| <span className="parameter-name"><span className="light-grey">options.</span>defaultRole</span> | <code>string</code> | | Default role of the user. Must be part of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>allowedRoles</span> | <code>Array&lt;string&gt;</code> | | Allowed roles of the user. Must be a subset of the default allowed roles defined in Hasura Auth. |
| <span className="parameter-name"><span className="light-grey">options.</span>locale</span> | <code>string</code> | | Locale of the user, in two digits |
---

View File

@@ -1,6 +1,5 @@
---
title: AuthCookieClient
sidebarTitle: AuthCookieClient
description: No description provided.
---

View File

@@ -0,0 +1,23 @@
---
title: connectProvider()
sidebarTitle: connectProvider()
---
Use `nhost.auth.connectProvider` to connect a social authentication provider to an existing user account
```ts
nhost.auth.connectProvider({
provider: 'github
options: {
redirectTo: window.location.href
}
})
```
## Parameters
---
**<span className="parameter-name">params</span>** <span className="optional-status">required</span> [`SignInWithProviderParams`](/reference/javascript/auth/types/sign-in-with-provider-params)
---

View File

@@ -7,7 +7,7 @@ Use `nhost.auth.getHasuraClaim` to get the value of a specific Hasura claim of t
```ts
// if `x-hasura-company-id` exists as a custom claim
const companyId = nhost.auth.getHsauraClaim('company-id')
const companyId = nhost.auth.getHasuraClaim('company-id')
```
## Parameters

View File

@@ -3,8 +3,20 @@ title: getSession()
sidebarTitle: getSession()
---
Use `nhost.auth.getSession()` to get the session of the user.
## Parameters
```ts
const session = nhost.auth.getSession()
```
---
**<span className="parameter-name">context</span>** <span className="optional-status">optional</span> [`AuthContext`](/reference/javascript/auth/types/auth-context)
| Property | Type | Required | Notes |
| :------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------- | :------: | :------------------------------------------------------------------------------------------------- |
| <span className="parameter-name"><span className="light-grey">context.</span>errors</span> | <code>Partial&lt;Record&lt;StateErrorTypes, AuthErrorPayload&gt;&gt;</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>importTokenAttempts</span> | <code>number</code> | ✔️ | Number of times the user tried to get an access token from a refresh token but got a network error |
| <span className="parameter-name"><span className="light-grey">context.</span>refreshToken</span> | <code>&#123; value: string &#124; null, isPAT: boolean &#125;</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>refreshTimer</span> | <code>&#123; startedAt: Date &#124; null, attempts: number, lastAttempt: Date &#124; null &#125;</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>accessToken</span> | <code>&#123; value: string &#124; null, expiresAt: Date &#124; null, expiresInSeconds: number &#124; null &#125;</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>mfa</span> | <code>&#123; ticket: string &#125; &#124; null</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">context.</span>user</span> | <code>[`User`](/reference/javascript/auth/types/user) &#124; null</code> | ✔️ | |
---

View File

@@ -1,6 +1,5 @@
---
title: HasuraAuthClient
sidebarTitle: Auth
description: No description provided.
---

View File

@@ -9,10 +9,10 @@ Note: The Nhost client automatically refreshes the session when the user is auth
```ts
// Refresh the session with the the current internal refresh token.
nhost.auth.refreshSession()
nhost.auth.refreshToken()
// Refresh the session with an external refresh token.
nhost.auth.refreshSession(refreshToken)
nhost.auth.refreshToken(refreshToken)
```
## Parameters

View File

@@ -46,3 +46,7 @@ Redirection path in the client application that will be used in the link in the
For instance, if you want to redirect to `https://myapp.com/success`, the `redirectTo` value is `'/success'`.
---
**<span className="parameter-name">connect</span>** <span className="optional-status">optional</span> <code>boolean</code>
---

View File

@@ -36,6 +36,7 @@ https://hasura.io/docs/1.0/graphql/core/auth/authentication/jwt.html#the-spec
| Property | Type | Required | Notes |
| :---------------------------------------------------------------------------------------------------------------------------------- | :------------------------------- | :------: | :---- |
| <span className="parameter-name"><span className="light-grey">https://hasura.io/jwt/claims.</span>x-hasura-auth-elevated</span> | <code>string</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">https://hasura.io/jwt/claims.</span>x-hasura-user-is-anonymous</span> | <code>string</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">https://hasura.io/jwt/claims.</span>x-hasura-user-id</span> | <code>string</code> | ✔️ | |
| <span className="parameter-name"><span className="light-grey">https://hasura.io/jwt/claims.</span>x-hasura-default-role</span> | <code>string</code> | ✔️ | |

View File

@@ -10,6 +10,10 @@ description: No description provided.
---
**<span className="parameter-name">x-hasura-auth-elevated</span>** <span className="optional-status">required</span> <code>string</code>
---
**<span className="parameter-name">x-hasura-user-is-anonymous</span>** <span className="optional-status">required</span> <code>string</code>
---

View File

@@ -47,6 +47,10 @@ For instance, if you want to redirect to `https://myapp.com/success`, the `redir
---
**<span className="parameter-name">connect</span>** <span className="optional-status">optional</span> <code>boolean</code>
---
**<span className="parameter-name">connection</span>** <span className="optional-status">optional</span> <code>string</code>
---

View File

@@ -47,6 +47,10 @@ For instance, if you want to redirect to `https://myapp.com/success`, the `redir
---
**<span className="parameter-name">connect</span>** <span className="optional-status">optional</span> <code>boolean</code>
---
**<span className="parameter-name">connection</span>** <span className="optional-status">optional</span> <code>string</code>
---

View File

@@ -23,6 +23,12 @@ const providerLink = useProviderLink()
const providerLink = useProviderLink()
```
Pass in the `connect` option to connect the user's account to the OAuth provider when different emails are used.
```js
const providerLink = useProviderLink({ connect: true })
```
```jsx
import { useProviderLink } from '@nhost/react'

View File

@@ -23,6 +23,12 @@ const providerLink = useProviderLink()
const providerLink = useProviderLink()
```
Pass in the `connect` option to connect the user's account to the OAuth provider when different emails are used.
```js
const providerLink = useProviderLink({ connect: true })
```
```jsx
import { useProviderLink } from '@nhost/vue'

View File

@@ -1,5 +1,33 @@
# @nhost-examples/cli
## 0.3.1
### Patch Changes
- @nhost/nhost-js@3.0.11
## 0.3.0
### Minor Changes
- 768ca17: chore: update dependencies
### Patch Changes
- @nhost/nhost-js@3.0.10
## 0.2.2
### Patch Changes
- @nhost/nhost-js@3.0.10
## 0.2.1
### Patch Changes
- @nhost/nhost-js@3.0.9
## 0.2.0
### Minor Changes

View File

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

View File

@@ -1,5 +1,43 @@
# @nhost-examples/codegen-react-apollo
## 0.4.1
### Patch Changes
- @nhost/react@3.4.1
- @nhost/react-apollo@11.0.1
## 0.4.0
### Minor Changes
- 768ca17: chore: update dependencies
### Patch Changes
- Updated dependencies [768ca17]
- @nhost/react-apollo@11.0.0
- @nhost/react@3.4.0
## 0.3.1
### Patch Changes
- Updated dependencies [311374e]
- @nhost/react@3.3.2
- @nhost/react-apollo@10.0.2
## 0.3.0
### Minor Changes
- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2` to address vulnerability
### Patch Changes
- @nhost/react@3.3.1
- @nhost/react-apollo@10.0.1
## 0.2.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/codegen-react-apollo",
"version": "0.2.0",
"version": "0.4.1",
"private": true,
"scripts": {
"codegen": "graphql-codegen",
@@ -15,7 +15,7 @@
]
},
"dependencies": {
"@apollo/client": "^3.9.5",
"@apollo/client": "^3.9.9",
"@nhost/react": "workspace:^",
"@nhost/react-apollo": "workspace:^",
"clsx": "^1.2.1",
@@ -24,18 +24,18 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@graphql-codegen/cli": "^2.16.5",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/client-preset": "^1.3.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@tailwindcss/forms": "^0.5.7",
"@types/node": "^18.19.21",
"@types/react": "^18.2.61",
"@types/react-dom": "^18.2.19",
"@types/node": "^18.19.28",
"@types/react": "^18.2.73",
"@types/react-dom": "^18.2.23",
"@vitejs/plugin-react": "^3.1.0",
"autoprefixer": "^10.4.17",
"postcss": "^8.4.35",
"tailwindcss": "^3.4.1",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"typescript": "^4.9.5",
"vite": "^5.1.4"
"vite": "^5.2.7"
}
}

View File

@@ -1,5 +1,39 @@
# @nhost-examples/codegen-react-query
## 0.4.1
### Patch Changes
- @nhost/react@3.4.1
## 0.4.0
### Minor Changes
- 768ca17: chore: update dependencies
### Patch Changes
- Updated dependencies [768ca17]
- @nhost/react@3.4.0
## 0.3.1
### Patch Changes
- Updated dependencies [311374e]
- @nhost/react@3.3.2
## 0.3.0
### Minor Changes
- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2` to address vulnerability
### Patch Changes
- @nhost/react@3.3.1
## 0.2.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/codegen-react-query",
"version": "0.2.0",
"version": "0.4.1",
"private": true,
"scripts": {
"codegen": "graphql-codegen",
@@ -25,18 +25,18 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@graphql-codegen/cli": "^2.16.5",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/client-preset": "^1.3.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@tailwindcss/forms": "^0.5.7",
"@types/node": "^16.18.86",
"@types/react": "^18.2.61",
"@types/react-dom": "^18.2.19",
"autoprefixer": "^10.4.17",
"@types/node": "^16.18.93",
"@types/react": "^18.2.73",
"@types/react-dom": "^18.2.23",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"postcss": "^8.4.35",
"tailwindcss": "^3.4.1",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"typescript": "^4.9.5",
"vite": "^5.1.4"
"vite": "^5.2.7"
}
}

View File

@@ -1,5 +1,43 @@
# @nhost-examples/react-urql
## 0.3.1
### Patch Changes
- @nhost/react@3.4.1
- @nhost/react-urql@8.0.1
## 0.3.0
### Minor Changes
- 768ca17: chore: update dependencies
### Patch Changes
- Updated dependencies [768ca17]
- @nhost/react-urql@8.0.0
- @nhost/react@3.4.0
## 0.2.1
### Patch Changes
- Updated dependencies [311374e]
- @nhost/react@3.3.2
- @nhost/react-urql@7.0.2
## 0.2.0
### Minor Changes
- 7789469: chore: upgrade dependency `@graphql-codegen/cli` to `5.0.2` to address vulnerability
### Patch Changes
- @nhost/react@3.3.1
- @nhost/react-urql@7.0.1
## 0.1.0
### Minor Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@nhost-examples/codegen-react-urql",
"private": true,
"version": "0.1.0",
"version": "0.3.1",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
@@ -18,18 +18,18 @@
"urql": "^3.0.4"
},
"devDependencies": {
"@graphql-codegen/cli": "^2.16.5",
"@graphql-codegen/cli": "^5.0.2",
"@graphql-codegen/client-preset": "^1.3.0",
"@graphql-typed-document-node/core": "^3.2.0",
"@tailwindcss/forms": "^0.5.7",
"@types/node": "^16.18.86",
"@types/react": "^18.2.61",
"@types/react-dom": "^18.2.19",
"@types/node": "^16.18.93",
"@types/react": "^18.2.73",
"@types/react-dom": "^18.2.23",
"@vitejs/plugin-react": "^3.1.0",
"autoprefixer": "^10.4.17",
"postcss": "^8.4.35",
"tailwindcss": "^3.4.1",
"autoprefixer": "^10.4.19",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"typescript": "^4.9.5",
"vite": "^5.1.4"
"vite": "^5.2.7"
}
}

View File

@@ -1,5 +1,17 @@
# @nhost-examples/docker-compose
## 0.4.0
### Minor Changes
- 768ca17: chore: update dependencies
## 0.3.0
### Minor Changes
- e40a452: chore: clarification on greyed-out options in the dashboard when self-hosting
## 0.2.0
### Minor Changes

View File

@@ -2,6 +2,8 @@
Here is an example on how to reproduce the Nhost stack from a docker-compose file.
NOTE: You may notice that some options in the dashboard are greyed-out. These include additional services like CI integration, configuration management, etc., offered by the Nhost Cloud and therefore are not accessible when self-hosting.
## Configuration
```sh

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/docker-compose",
"version": "0.2.0",
"version": "0.4.0",
"private": true,
"scripts": {
"e2e": "vitest run"

View File

@@ -1,5 +1,33 @@
# @nhost-examples/multi-tenant-one-to-many
## 2.2.1
### Patch Changes
- @nhost/nhost-js@3.0.11
## 2.2.0
### Minor Changes
- 768ca17: chore: update dependencies
### Patch Changes
- @nhost/nhost-js@3.0.10
## 2.1.2
### Patch Changes
- @nhost/nhost-js@3.0.10
## 2.1.1
### Patch Changes
- @nhost/nhost-js@3.0.9
## 2.1.0
### Minor Changes

View File

@@ -1,7 +1,7 @@
{
"name": "@nhost-examples/multi-tenant-one-to-many",
"private": true,
"version": "2.1.0",
"version": "2.2.1",
"description": "",
"main": "index.js",
"scripts": {},
@@ -10,7 +10,7 @@
"license": "ISC",
"devDependencies": {
"@types/express": "^4.17.21",
"express": "^4.18.3",
"express": "^4.19.2",
"typescript": "^4.9.5"
},
"dependencies": {

View File

@@ -1,5 +1,43 @@
# @nhost-examples/nextjs
## 0.3.1
### Patch Changes
- @nhost/react@3.4.1
- @nhost/react-apollo@11.0.1
- @nhost/nextjs@2.1.10
## 0.3.0
### Minor Changes
- 768ca17: chore: update dependencies
### Patch Changes
- Updated dependencies [768ca17]
- @nhost/react-apollo@11.0.0
- @nhost/react@3.4.0
- @nhost/nextjs@2.1.9
## 0.2.2
### Patch Changes
- Updated dependencies [311374e]
- @nhost/react@3.3.2
- @nhost/react-apollo@10.0.2
- @nhost/nextjs@2.1.8
## 0.2.1
### Patch Changes
- @nhost/react@3.3.1
- @nhost/react-apollo@10.0.1
- @nhost/nextjs@2.1.7
## 0.2.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/nextjs",
"version": "0.2.0",
"version": "0.3.1",
"private": true,
"scripts": {
"dev": "next dev",
@@ -15,7 +15,7 @@
"verify:fix": "run-p prettier:fix lint:fix"
},
"dependencies": {
"@apollo/client": "^3.9.5",
"@apollo/client": "^3.9.9",
"@mantine/core": "^4.2.12",
"@mantine/hooks": "^4.2.12",
"@mantine/next": "^4.2.12",
@@ -24,15 +24,15 @@
"@nhost/react": "workspace:^",
"@nhost/react-apollo": "workspace:^",
"graphql": "16.8.1",
"next": "^14.1.0",
"next": "^14.1.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-icons": "^4.12.0"
},
"devDependencies": {
"@next/bundle-analyzer": "^12.3.4",
"@types/node": "^16.18.86",
"@types/react": "^18.2.61",
"@types/node": "^16.18.93",
"@types/react": "^18.2.73",
"@xstate/inspect": "^0.6.5",
"eslint-config-next": "12.0.10",
"typescript": "^4.9.5",

View File

@@ -1,5 +1,33 @@
# @nhost-examples/node-storage
## 0.2.1
### Patch Changes
- @nhost/nhost-js@3.0.11
## 0.2.0
### Minor Changes
- 768ca17: chore: update dependencies
### Patch Changes
- @nhost/nhost-js@3.0.10
## 0.1.2
### Patch Changes
- @nhost/nhost-js@3.0.10
## 0.1.1
### Patch Changes
- @nhost/nhost-js@3.0.9
## 0.1.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost-examples/node-storage",
"version": "0.1.0",
"version": "0.2.1",
"private": true,
"description": "This is an example of how to use the Storage with Node.js",
"main": "src/index.mjs",
@@ -19,7 +19,7 @@
"uuid": "^9.0.1"
},
"devDependencies": {
"@types/node": "^18.19.21",
"@types/node": "^18.19.28",
"@types/uuid": "^9.0.8"
}
}

View File

@@ -1,6 +1,7 @@
module.exports = {
extends: ['../../../config/.eslintrc.js', 'plugin:@next/next/recommended'],
rules: {
'react/react-in-jsx-scope': 'off'
'react/react-in-jsx-scope': 'off',
'@next/next/no-server-import-in-page': 'off'
}
}

View File

@@ -1,5 +1,33 @@
# @nhost-examples/nextjs-server-components
## 0.4.1
### Patch Changes
- @nhost/nhost-js@3.0.11
## 0.4.0
### Minor Changes
- 768ca17: chore: update dependencies
### Patch Changes
- @nhost/nhost-js@3.0.10
## 0.3.2
### Patch Changes
- @nhost/nhost-js@3.0.10
## 0.3.1
### Patch Changes
- @nhost/nhost-js@3.0.9
## 0.3.0
### Minor Changes

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