Compare commits

..

20 Commits

Author SHA1 Message Date
github-actions[bot]
5fed49e05b chore: update versions (#3370)
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-storage-js@2.8.0

### Minor Changes

-   aee9a80: chore: update typescript version to the latest

## @nhost/nhost-js@3.3.0

### Minor Changes

-   aee9a80: chore: update typescript version to the latest

### Patch Changes

-   Updated dependencies [aee9a80]
    -   @nhost/hasura-storage-js@2.8.0

## @nhost/apollo@9.0.0

### Patch Changes

-   Updated dependencies [aee9a80]
    -   @nhost/nhost-js@3.3.0

## @nhost/react-apollo@18.0.1

### Patch Changes

-   @nhost/apollo@9.0.0
-   @nhost/react@3.11.1

## @nhost/react-urql@15.0.1

### Patch Changes

-   @nhost/react@3.11.1

## @nhost/nextjs@2.2.9

### Patch Changes

-   @nhost/react@3.11.1

## @nhost/react@3.11.1

### Patch Changes

-   Updated dependencies [aee9a80]
    -   @nhost/nhost-js@3.3.0

## @nhost/vue@2.9.7

### Patch Changes

-   Updated dependencies [aee9a80]
    -   @nhost/nhost-js@3.3.0

## @nhost/dashboard@2.33.0

### Minor Changes

-   aee9a80: chore: update typescript version to the latest
-   5ef3f76: chore (dashboard): Use the new SDK in the Dashboard

### Patch Changes

- 9ed8ce8: fix (dashboard): Request new Mfa ticket after an invalid totp
when signing in
- fd3b5c7: fix (dashboard): Limit new project's name to a maximum of 32
charachters in E2E tests

## @nhost/docs@2.33.0

### Minor Changes

-   4ca9641: feat: added cloud development documentation

## @nhost-examples/cli@0.3.23

### Patch Changes

-   Updated dependencies [aee9a80]
    -   @nhost/nhost-js@3.3.0

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

### Patch Changes

-   @nhost/react@3.11.1
-   @nhost/react-apollo@18.0.1

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

### Patch Changes

-   @nhost/react@3.11.1

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

### Patch Changes

-   @nhost/react@3.11.1
-   @nhost/react-urql@15.0.1

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

### Patch Changes

-   Updated dependencies [aee9a80]
    -   @nhost/nhost-js@3.3.0

## @nhost-examples/nextjs@0.4.9

### Patch Changes

-   @nhost/react@3.11.1
-   @nhost/react-apollo@18.0.1
-   @nhost/nextjs@2.2.9

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

### Patch Changes

-   Updated dependencies [aee9a80]
    -   @nhost/nhost-js@3.3.0

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

### Patch Changes

-   Updated dependencies [aee9a80]
    -   @nhost/nhost-js@3.3.0

## @nhost-examples/sveltekit@0.8.2

### Patch Changes

-   Updated dependencies [aee9a80]
    -   @nhost/nhost-js@3.3.0

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

### Patch Changes

-   @nhost/react@3.11.1
-   @nhost/react-apollo@18.0.1

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

### Patch Changes

-   @nhost/react@3.11.1

## @nhost-examples/react-native@0.1.10

### Patch Changes

-   @nhost/react@3.11.1
-   @nhost/react-apollo@18.0.1

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

### Patch Changes

-   Updated dependencies [aee9a80]
    -   @nhost/nhost-js@3.3.0
    -   @nhost/apollo@9.0.0
    -   @nhost/vue@2.9.7

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

### Patch Changes

-   @nhost/apollo@9.0.0
-   @nhost/vue@2.9.7

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-01 13:00:12 +02:00
robertkasza
aee9a80ac8 chore: update typescript to latest version (#3376)
### **PR Type**
Enhancement, Other


___

### **Description**
- Update TypeScript to version 5.8.3

- Upgrade react-merge-refs to version 3.0.2

- Refactor import syntax for mergeRefs

- Update tsconfig settings for modern JavaScript


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>11
files</summary><table>
<tr>
<td><strong>ControlledAutocomplete.tsx</strong><dd><code>Update import
syntax for mergeRefs</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-e1bbef866e556facc768a4239b443e193f460321689e368fcaae31c1a7c90478">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>ControlledCheckbox.tsx</strong><dd><code>Update import and
type reference for mergeRefs</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-6f7d29735900a65f96663da4719bf151c5c98224c0a4e39d84b9e5e1db6b8c42">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>ControlledSelect.tsx</strong><dd><code>Update import and
type reference for mergeRefs</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-4dda68ad8ea568203b515c9cb81eabd05109f55b10e96712924744aba8c22468">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>ControlledSwitch.tsx</strong><dd><code>Update import syntax
for mergeRefs</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-173b17a003d4d330b2a7157258d0d34cbbbac6ae10840245294f22a8e6ef89ed">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>Checkbox.tsx</strong><dd><code>Update ForwardedRef type for
Checkbox component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-16e6ada0fb8f9c0ecaa00fcfc61c166d0c4c051efe5345d58ee5e4ab618ca0c5">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>Input.tsx</strong><dd><code>Update import syntax for
mergeRefs</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-16643cae2ae39d51faa2ed4d7e045f4ec2af31ec5f91768cff742e0364400cb1">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>Radio.tsx</strong><dd><code>Update ForwardedRef type for
Radio component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-cab2e6a6d80963fb89d93b52ac228ab8f2e2d9d60d3d2567547da562e922ac63">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>LogsServiceFilter.tsx</strong><dd><code>Update ForwardedRef
type for LogsServiceFilter</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-a590a7298a9f040df9f26c4eb37d10fc36f47c32996f71aec47796f08c44e892">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>ReferencedSchemaSelect.tsx</strong><dd><code>Update
ForwardedRef type for ReferencedSchemaSelect</code>&nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-450038e1607012a27e047ef0fa3e7c3ba58a4be7750940aa21c7166713b15c76">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>DataGrid.tsx</strong><dd><code>Update import syntax for
mergeRefs</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-3bc6476aed14d8e4f26134fa452d22c41b6d3ecb0989871a8a99230a82496474">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>DataGridBooleanCell.tsx</strong><dd><code>Update
useDataGridCell generic type</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-b700eacab9c73b147e248ce58d47a208c1e499124a20444efd73db7ecb68505f">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

</table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>1
files</summary><table>
<tr>
<td><strong>getAllocatedResources.test.ts</strong><dd><code>Remove
replicas property from test cases</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-c7db4fcf0770eb6e4eba76db64b1c705404538a3c204ea212028cad591c6d85a">+0/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></details></td></tr><tr><td><strong>Configuration
changes</strong></td><td><details><summary>4 files</summary><table>
<tr>
<td><strong>tsconfig.base.json</strong><dd><code>Update TypeScript
compiler options for ES2022</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-1542b47836923af953e9f14d4db6843171edb79232ba834276394b4ed3035c63">+4/-15</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>tsconfig.json</strong><dd><code>Update TypeScript target and
adjust paths</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-9c3967d850eef2a3a17b5169df09de68ecb0f24ec46f0a9dd1b3ca7c6da7a384">+9/-4</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>tsconfig.json</strong><dd><code>Add typeRoots to compiler
options</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-aa2c7a9ede2c1897e087efac48742cf228b8af42e73dec31ec6403461b98c63a">+6/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>tsconfig.json</strong><dd><code>Add typeRoots to compiler
options</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-6b59df76b8f353267e50f13e5fdd23ff7490a417bdc9b7e9f4e94aaafa448dcd">+7/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

</table></details></td></tr><tr><td><strong>Dependencies</strong></td><td><details><summary>2
files</summary><table>
<tr>
<td><strong>package.json</strong><dd><code>Upgrade react-merge-refs to
version 3.0.2</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-2d8d55c799cd71f1b35e831f075f8178ed1734c4820a2ad548b4dd24d6938d7c">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>package.json</strong><dd><code>Upgrade TypeScript to version
5.8.3</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3376/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></details></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
2025-07-01 11:07:17 +02:00
robertkasza
5ef3f76ea0 chore (dashboard): use new sdk on the dashboard (#3374)
### **PR Type**
Enhancement, Bug fix


___

### **Description**
- Migrate from @nhost/nextjs to @nhost/nhost-js-beta

- Update authentication flow and components

- Refactor Apollo client and GraphQL operations

- Implement new session management and storage


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Error
handling</strong></td><td><details><summary>1 files</summary><table>
<tr>
<td><strong>MfaOtpForm.tsx</strong><dd><code>Refactor MFA OTP form error
handling</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-88ee3610a0658d5eead85db025a5e91e74a4d2f2a836adf7eb44ff80888a613b">+11/-9</a>&nbsp;
&nbsp; </td>

</tr>

</table></details></td></tr><tr><td><strong>Enhancement</strong></td><td><details><summary>66
files</summary><table>
<tr>
<td><strong>AccountMenu.tsx</strong><dd><code>Update account menu to use
new SDK hooks</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-57e70c7e6a22a5ab5271b2f36a54eabf544d9f62cd18dae83e2e89b125e77e0c">+10/-10</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>AuthenticatedLayout.tsx</strong><dd><code>Refactor
authenticated layout with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-2d69ccffd267658f76d77a864cdece93fc222e08f6025955795fc6f4697f60e7">+15/-13</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>MobileNav.tsx</strong><dd><code>Update mobile navigation to
use new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-88408885daaec8805bd085b53462c9f2d95db32f7e523912837a8167211b4fb2">+14/-8</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>UnauthenticatedLayout.tsx</strong><dd><code>Refactor
unauthenticated layout with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-54ee5ad9c01e99ffb05218020a6b97d091cd97cc53ad27e950480a3e675f2220">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>ErrorToast.tsx</strong><dd><code>Update error toast to use
new SDK hooks</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-189ba99303a20e964b5e3f3d6f1cf95c6376780a59604d1dee98aa84d9a2a9dc">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>DisableMfaButton.tsx</strong><dd><code>Refactor MFA disable
button with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-8548174093cd8b3bcd754b630c0bcc946e7cdc80176f8e0f0540fd60c9e47486">+17/-18</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>MfaQRCodeAndTOTPSecret.tsx</strong><dd><code>Update MFA
enable process with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-91870bba41e6e807ced8d185a9d61282540ca82741a938b12f20c4f452bdabf8">+30/-29</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>useMfaEnabled.ts</strong><dd><code>Refactor MFA enabled hook
with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-31d2af339a8dd32beff8cce79962fa0dd23b6c89687b21aa75663ebeccb0b154">+3/-3</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>CreatePATForm.tsx</strong><dd><code>Update PAT creation form
with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-75aecb06ebb3e3cd0de6bf253af6966e245e46e9b739314d49073ba2c80a3a90">+6/-6</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>DeleteAccount.tsx</strong><dd><code>Refactor account
deletion with new SDK hooks</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-3d84927ffa4b91d986ff6c6f601b3476503220e1c1d8cde25ebf72c8d0ed6b9e">+4/-3</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>DisplayNameSetting.tsx</strong><dd><code>Update display name
setting with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-a1daec18d5c3196aee5b2c5303db5654724f8d37cfa427594951a4d02fbe32db">+4/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>EmailSetting.tsx</strong><dd><code>Refactor email setting
with new SDK hooks</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-98bdf4ebec67ab2b4cd475c9df16a39a66505da961a8448eb5e41a33544dcb38">+4/-3</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useOnChangePasswordHandler.ts</strong><dd><code>Update
password change handler with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-be0c02de792e4ba1b71258eb3992bbc531bc37658cbad0e01e2db4419a9285f1">+4/-4</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useOnAddNewSecurityKeyHandler.ts</strong><dd><code>Refactor
security key addition with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-3514a6d1514269a83f37fc25e9cb24add9d5d74f9cf3341293c0e0f2a4c2e286">+10/-2</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>useRemoveSecurityKey.ts</strong><dd><code>Update security
key removal with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-5683e00a14f39018d8fe58a3116c2a8ea6d2f2a83abb2177bbf0ee8ddf0f97b5">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>SocialProvidersSettings.tsx</strong><dd><code>Refactor
social providers settings with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-82d7c0c9eb3a23586998b6eadff9e56b123b14d03179212ca82439d3bdcd6e96">+14/-5</a>&nbsp;
&nbsp; </td>

</tr>

<tr>

<td><strong>useActionWithElevatedPermissions.ts</strong><dd><code>Update
elevated permissions hook with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-3390879c4a0cd70aa1db6672a1607c5c2444c0bf653b711d73eda8ee466aa61a">+10/-16</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>useElevatedPermissions.ts</strong><dd><code>Refactor
elevated permissions hook with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-c1e4f573300c771149cc2e59918c9acf2ae5f8a6680800a899707c70800ba144">+11/-10</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>useGetSecurityKeys.ts</strong><dd><code>Update security keys
fetching with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-1f9fed870cab61f15e304342e4913edab0f5537eeb6230070de4b4f7173fa138">+3/-3</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useGithubAuthentication.ts</strong><dd><code>Refactor GitHub
authentication with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-fad4875e0f07391dadcfc7e2dd481cafd5172dbb740c47e56fa75beb271618e1">+16/-8</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>SignInWithSecurityKey.tsx</strong><dd><code>Update security
key sign-in with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-dc892fd3d9fd3cc7efca35c813cea43c63aa691b1d55d376ac69a2d75065bde9">+9/-3</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>VerifyEmailDialog.tsx</strong><dd><code>Refactor email
verification dialog for security key</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-24699641924d25d9b2d72b7df5da44d837e1c1e5c77b9f4b00f7c07d12c72c42">+4/-10</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>useSignInWithSecurityKey.ts</strong><dd><code>Update
security key sign-in hook with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-14ce9eae9e1ec03512bdd55198fbce47a81ce8ce769d002164926d2cc76e91aa">+34/-21</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>MfaSignInOtpForm.tsx</strong><dd><code>Refactor MFA OTP form
for sign-in</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-91eba232beb0543b1e972ed9a21a0be797ed94b720487834bb3316a5dbd732f5">+1/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>SignInWithEmailAndPassword.tsx</strong><dd><code>Update
email/password sign-in with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-a2b70644663baf4f6f2cdffd846d4d743a5ca1f2a64c4b278b6f04c6c5c92161">+34/-12</a>&nbsp;
</td>

</tr>

<tr>

<td><strong>SignInWithEmailAndPasswordForm.tsx</strong><dd><code>Refactor
email/password sign-in form with loading state</code>&nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-a07fd6bd20c97d0c9c875e690cd3a80068fc58f74d3579feb210e189d32f5031">+5/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>

<td><strong>useOnSignInWithEmailAndPasswordHandler.ts</strong><dd><code>Update
email/password sign-in handler with new SDK</code>&nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-1a253bfc02c3267ab1c6b58c07aa06142b7e711d613b672c8420ff2861b12d27">+35/-37</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>useRequestNewMfaTicket.ts</strong><dd><code>Refactor MFA
ticket request with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-64a3a91cf75c8faf5bf6a9fdd23978659d68888744a92f82602b1a2f7290c1f6">+12/-11</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>useOnSignUpWithPasswordHandler.ts</strong><dd><code>Update
email/password sign-up handler with new SDK</code>&nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-d1a80c5b1076129735ffff9ea879ca8c8fe88e548d06e98a1fb6bfd7147dae01">+14/-19</a>&nbsp;
</td>

</tr>

<tr>

<td><strong>useSignupWithSecurityKeyHandler.ts</strong><dd><code>Refactor
security key sign-up with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-cef4f710ea89c67e27e9fe77db2d2ebc6d774657e0671b21b7353f3e927126bd">+24/-17</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>CreateOrgFormDialog.tsx</strong><dd><code>Update
organization creation dialog with new SDK</code>&nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-9a1ed9e851328393b81356d80ade3509016aa55c254ed1f4deb692b0bd96f02e">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>TransferProjectForm.tsx</strong><dd><code>Refactor project
transfer form with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-3324c79d8b4d48777467132ba0f13a95d4b0f1a9fbb4df9fd7f67735ac40cbbd">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>Soc2Download.tsx</strong><dd><code>Update SOC2 report
download with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-3768eb3fc718d4780028c34b5c76388e8d93cbbac94868f82c1a262fb9cc1100">+12/-19</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>AnnouncementsTray.tsx</strong><dd><code>Refactor
announcements tray with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-88fdcce3e90fa9e4d172858ae702855f86e6ece724ba443d8a6ed918999a1630">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>NotificationsTray.tsx</strong><dd><code>Update notifications
tray with new SDK hooks</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-8b559ee1d3176203e8a4e1588924d57944d09d792117ed578b27cd5401ee5d4f">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>OrgMember.tsx</strong><dd><code>Refactor organization member
component with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-a50b1baab968a7d3bd1459ba01107a13bd25e5077b6ad49a0d7e9dd88992276a">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useFinishOrgCreation.ts</strong><dd><code>Update
organization creation finish hook with new SDK</code>&nbsp; &nbsp;
&nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-3b8bf7608ab36d8ab0df895e400f0d2d9e29fad2055b40b33d8d9912a27c99c3">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useIsOrgAdmin.ts</strong><dd><code>Refactor organization
admin check with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-216a850dad38e829d0a8892c34d87426cd68f10c92f4c647673667dbbd11464d">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>MessageBox.tsx</strong><dd><code>Update dev assistant
message box with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-d4dd97b5a55f8246836226333d35a1c18c2907e47bdd2654707ed43ac54f2fb8">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>ApplicationInfo.tsx</strong><dd><code>Refactor application
info component with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-7372ad22d70c3c354d8e0dd442eb7e49f70f65a386b934b6eee7f8c4b89c3a3f">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>ApplicationPausedBanner.tsx</strong><dd><code>Update paused
application banner with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-fa94285530f7118d9f27a2d9088f5cf6ba71879d14957d91eb01dba16b6b6f1c">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>RemoveApplicationModal.tsx</strong><dd><code>Refactor
application removal modal with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-e454a42c12dcbfcfaa463ab3421037408634e3a539f460525c79d68adfc118ab">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useAppPausedReason.ts</strong><dd><code>Update app paused
reason hook with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-51d220574b3da84f08d2cb134682172ed11b908c4d855ccc8d9de30805921a00">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useCheckProvisioning.ts</strong><dd><code>Refactor
provisioning check hook with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-e1758bb8d3381f814d6619dc33eee8b36e39d2fcb6486d5c8cc3c46bbe62c555">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useIsCurrentUserOwner.ts</strong><dd><code>Update current
user ownership check with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-3941cc4f23c66f12e94850e88e05ca142a627ab2d9ec797ff757dab679c58c0f">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useProjectRedirectWhenReady.ts</strong><dd><code>Refactor
project redirect hook with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-a234bc908266de3091b23b5134a01fd769f96759eb52aa108d2ad4b796b0303f">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>ResetDatabasePasswordSettings.tsx</strong><dd><code>Update
database password reset with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-46fc60a26a2de3efb98e9778b1c6e82d62823ae5c7534037eb120728cba26288">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>DeploymentListItem.tsx</strong><dd><code>Refactor deployment
list item with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-2a548c457ff2ab8fc1bee326a6a3b5eae9d0d6eb18f5ae95bbdb437c3f6b0a73">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>

<td><strong>SystemEnvironmentVariableSettings.tsx</strong><dd><code>Update
system environment variables with new SDK</code>&nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-b952daa2a34e49a14c5a471477fa2d50583091e420d88a3b941503b092d18e5c">+7/-4</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>BaseDirectorySettings.tsx</strong><dd><code>Refactor base
directory settings with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-50bcccdf949a19ce69fa86acdd63b5291fa2beaba07191a62c87d40ea5b94e88">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>DeploymentBranchSettings.tsx</strong><dd><code>Update
deployment branch settings with new SDK</code>&nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-d8fc80cc734f593c686f873536856bf9103efb1115ca865709bbeb7bd940895e">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useAppClient.ts</strong><dd><code>Refactor app client hook
with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-0aa83222c0e0eac6f0058070de2b199e5e78514cbba405eb98d3693329a93e65">+13/-6</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>useCurrentOrg.tsx</strong><dd><code>Update current
organization hook with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-97e1dbde4beece374834d5e81dd56fddeb5f1756a3358f6afecf88df93f6b0b0">+60/-3</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>useOrgs.ts</strong><dd><code>Refactor organizations hook
with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-995629b13bac07ec5c0e79caa8f5f8df19fc842d1b8cfe8fd2b1fcd9448868c4">+5/-6</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useProject.ts</strong><dd><code>Update project hook with new
SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-ef96f340af7a87a1fc60c42d8f4de846a2a54fde830a9461c64cfbc99dc11128">+8/-10</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>useProjectLogs.ts</strong><dd><code>Update project logs hook
with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-10efc67700b3f024dd03442eacd339802e951696d04caa76bd5a864bd5c7c83f">+2/-3</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useProjectWithState.ts</strong><dd><code>Refactor project
with state hook using new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-4fa0e580d9f12e35ff5d2751597bf443bd055cd1c854cf6b356110724d424188">+7/-7</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>DataGridPreviewCell.tsx</strong><dd><code>Update data grid
preview cell with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-d7bffe5896d2c9bac505fa9675790c59549d4fb35a2ad0cce903cc0aa31a8321">+7/-3</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>FilesDataGrid.tsx</strong><dd><code>Refactor files data grid
with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-18c8df727e1a4fc6a94d03bd4a3a7a8cb3ad44d754803c4c7988c1c00a4b7caf">+20/-15</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>FilesDataGridControls.tsx</strong><dd><code>Update files
data grid controls with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-b85b40168e9c149331a68cb1a0cbec570c75233fa34385945e094b8f4c032974">+15/-30</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>useAccessToken.ts</strong><dd><code>Add new hook for
accessing token with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-1e7322930841a7ee092650eedafab9b83a8eb2d376aa299f3dfd790304a7ad21">+9/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useDecodedAccessToken.ts</strong><dd><code>Add new hook for
decoding access token</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-ff3f112dfd0dae55404d17d972f5309d9a8cf0859222061e1c6f10e52c442390">+28/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>useElevateEmail.ts</strong><dd><code>Add new hook for email
elevation with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-b38d4c8f500fe9f40d4649e78907fc2f8691bd950b377e85be9142226b2b3460">+26/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>useHasuraClaims.ts</strong><dd><code>Add new hook for Hasura
claims with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-f5352373468a509527f74db8d16a632905284009ed386ea50cd9fb7f42817431">+11/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>useUserData.ts</strong><dd><code>Add new hook for user data
with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-3e3f3684aba10abe1d06d0be625a8077efe2e7d6a17b79d5ecddd43cfc190224">+12/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>index.ts</strong><dd><code>Remove old remote application
GraphQL client hook</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-d2d725306920bf5413fc010843e4ca13570b225febb200330e8c6902ae0b085c">+0/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

</table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>1
files</summary><table>
<tr>
<td><strong>useProjectLogs.test.ts</strong><dd><code>Refactor project
logs test with new SDK</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3374/files#diff-13d900aa08d06962a09628136b893801ad62a96c3ff89d380c5c4b7ae92d891e">+19/-31</a>&nbsp;
</td>

</tr>
</table></details></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
2025-06-30 14:31:29 +02:00
David Barroso
4ca9641304 feat (docs): added cloud development documentation (#3377) 2025-06-25 23:24:10 +02:00
robertkasza
fd3b5c77e4 fix (dashboard): Limit new project name to a max of 32 chars (#3371)
### **PR Type**
Bug fix, Tests


___

### **Description**
- Limit new project name to 32 characters in E2E tests

- Update project creation test in upgrade-project.test.ts

- Add changeset for @nhost/dashboard patch


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug
fix</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>upgrade-project.test.ts</strong><dd><code>Limit project
name length in E2E test</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

dashboard/e2e/upgrade-project/upgrade-project.test.ts

<li>Modify project name generation to limit to 32 characters<br> <li>
Use <code>slice(0, 32)</code> on faker-generated project name


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3371/files#diff-8bafbe707eb1dff0c5ae24d6b0a514ff6e80889237de6c89ec330a93be138a12">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Documentation</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>weak-bottles-stare.md</strong><dd><code>Add changeset
for project name length fix</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

.changeset/weak-bottles-stare.md

<li>Add new changeset file for @nhost/dashboard patch<br> <li> Document
fix for limiting project name to 32 characters


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3371/files#diff-352316104f52e31fc130d1016f300d58c243319c6e6e434c9bc6912402117d6a">+5/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
2025-06-18 15:50:56 +02:00
robertkasza
9ed8ce8a5e fix (dashboard): request new mfa ticket after error when signing in (#3369)
### **PR Type**
Bug fix


___

### **Description**
- Request new MFA ticket after invalid TOTP

- Improve error handling in MFA flow

- Add comprehensive tests for MfaOtpForm

- Refactor SignInWithEmailAndPassword component


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><details><summary>1
files</summary><table>
<tr>
<td><strong>MfaOtpForm.test.tsx</strong><dd><code>Add comprehensive
tests for MfaOtpForm component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3369/files#diff-0a0a9d4aa607a60fb4f38712686101d583426536ff6c177ea625cf8ce1946971">+519/-0</a>&nbsp;
</td>

</tr>

</table></details></td></tr><tr><td><strong>Enhancement</strong></td><td><details><summary>5
files</summary><table>
<tr>
<td><strong>MfaOtpForm.tsx</strong><dd><code>Implement MFA ticket
renewal and improve error handling</code>&nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3369/files#diff-88ee3610a0658d5eead85db025a5e91e74a4d2f2a836adf7eb44ff80888a613b">+39/-12</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>MfaSignInOtpForm.tsx</strong><dd><code>Add
requestNewMfaTicket prop to MfaSignInOtpForm</code>&nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3369/files#diff-91eba232beb0543b1e972ed9a21a0be797ed94b720487834bb3316a5dbd732f5">+7/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>SignInWithEmailAndPassword.tsx</strong><dd><code>Implement
requestNewMfaTicket function and pass to
MfaSignInOtpForm</code></dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3369/files#diff-a2b70644663baf4f6f2cdffd846d4d743a5ca1f2a64c4b278b6f04c6c5c92161">+20/-4</a>&nbsp;
&nbsp; </td>

</tr>

<tr>

<td><strong>useOnSignInWithEmailAndPasswordHandler.ts</strong><dd><code>Add
emailPasswordRef to store credentials for MFA renewal</code></dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3369/files#diff-1a253bfc02c3267ab1c6b58c07aa06142b7e711d613b672c8420ff2861b12d27">+19/-2</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>useRequestNewMfaTicket.ts</strong><dd><code>Create new hook
for requesting new MFA ticket</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3369/files#diff-64a3a91cf75c8faf5bf6a9fdd23978659d68888744a92f82602b1a2f7290c1f6">+28/-0</a>&nbsp;
&nbsp; </td>

</tr>
</table></details></td></tr><tr><td><strong>Bug
fix</strong></td><td><details><summary>1 files</summary><table>
<tr>
<td><strong>email.tsx</strong><dd><code>Fix page title for sign-in
page</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3369/files#diff-b5d7db4460066bc114cb766771612d6f908bd6e440f40de98e4ac311a26b50cd">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

</table></details></td></tr><tr><td><strong>Documentation</strong></td><td><details><summary>1
files</summary><table>
<tr>
<td><strong>lovely-days-whisper.md</strong><dd><code>Add changeset for
MFA ticket renewal fix</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3369/files#diff-1d7e7e258210abb910bb9c392731a3195ffca03024082c4b357e61c475dd3e3f">+5/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></details></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
2025-06-18 14:02:18 +02:00
Ivan Kuznetsov
e7762cb2b5 fix (examples/nextjs-server-components): added missing await (#3364) 2025-06-17 11:53:38 +02:00
gssakash-nhost
e353d99de8 feat (examples/react-apollo): add more social providers (#3339)
### **User description**
___

### **PR Type**
Enhancement


___

### **Description**
- **Added OAuth Integrations**  
Enabled OAuth for Spotify, Twitch, GitLab, Bitbucket, WorkOS, Discord,
AzureAD, Facebook, Strava, Windows Live, and Twitter.
- **Enhanced UI**  
  Added login buttons for each provider.
- **Updated Configuration**  
Configured OAuth settings in `nhost.toml` and updated the authentication
version as necessary.
- **Included Example Credentials**  
  Added client credentials to `.secrets.example` for easy setup.

___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>oauth-links.tsx</strong><dd><code>Add Spotify OAuth
button to login options</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

examples/react-apollo/src/components/auth/oauth-links.tsx

<li>Imported Spotify icon from react-simple-icons<br> <li> Added Spotify
to useProviderLink hook<br> <li> Implemented Spotify login button with
styling


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3339/files#diff-f5999fa99948c7a83619e69ab669da87ca10146ad5742f93112e21b00932bc0e">+14/-2</a>&nbsp;
&nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>nhost.toml</strong><dd><code>Enable Spotify OAuth in
e2e test project</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

dashboard/e2e/e2e-tests-project/nhost/nhost.toml

- Enabled Spotify OAuth method


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3339/files#diff-9803f45ffb53ea1df64006a0bb2d3cb01ae0a3104f021945c546e97ee0e63f9e">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>.secrets.example</strong><dd><code>Add Spotify
credentials to secrets example</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

examples/react-apollo/.secrets.example

- Added placeholders for Spotify client ID and secret


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3339/files#diff-8df9deedb2d447b8e687d9bddcdeb89e013380307483034c4fc8973354877703">+2/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>nhost.toml</strong><dd><code>Configure Spotify OAuth in
example project</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

examples/react-apollo/nhost/nhost.toml

<li>Enabled Spotify OAuth method<br> <li> Added configuration for
Spotify client ID and secret


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3339/files#diff-268d6c8dddd6990d60d62c1c923955c4e0e7549a80f0f5856192f889378416a0">+3/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>

---------

Co-authored-by: David Barroso <dbarrosop@dravetech.com>
2025-06-13 11:06:43 +02:00
David Barroso
c4d289a4d5 chore (docs): added limits section (#3367)
### **PR Type**
Documentation, Enhancement


___

### **Description**
- Added new 'Limits' section to Functions overview

- Detailed function execution timeout limits by project tier

- Included custom timeout option for Enterprise tier


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Documentation</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>overview.mdx</strong><dd><code>Add Function Execution
Timeout Limits Section</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

docs/products/functions/overview.mdx

<li>Added new 'Limits' section after deployment information<br> <li>
Listed function execution timeout limits for different project tiers<br>
<li> Included Starter, Pro, Teams, and Enterprise tier limits<br> <li>
Mentioned custom timeout values for Enterprise tier


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3367/files#diff-c1e4e354976e7a602620f2540bb357b7d4d73853f8310342a75e1e14d4fd35f3">+9/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
2025-06-12 14:24:32 +02:00
github-actions[bot]
e2065e22df chore: update versions (#3360)
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@2.32.0

### Minor Changes

-   736862c: fix: update link to base directory docs in git settings
-   ea99fb3: chore: dashboard: improve messaging when git connected

### Patch Changes

-   d738884: chore (dashboard): Add link about antivirus integration

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-10 14:17:38 +02:00
robertkasza
d738884d7d chore (dashboard): Add link about antivirus integration (#3363)
### **PR Type**
Enhancement, Documentation


___

### **Description**
- Add antivirus integration documentation link

- Update HasuraStorageAVSettings component

- Create changeset for dashboard patch


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>HasuraStorageAVSettings.tsx</strong><dd><code>Add
antivirus documentation link to settings component</code>&nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>


dashboard/src/features/orgs/projects/storage/settings/components/StorageAVSettings/HasuraStorageAVSettings.tsx

- Add `docsLink` prop to component with antivirus documentation URL


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3363/files#diff-8670582543f3e6a6b3352202b89823cd68828328a987107e6c538e962347e781">+1/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Documentation</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>pink-grapes-cheat.md</strong><dd><code>Add changeset
for dashboard antivirus link update</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

.changeset/pink-grapes-cheat.md

<li>Create new changeset file for dashboard patch<br> <li> Add
description for antivirus integration link addition


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3363/files#diff-08b9cb5cc1ddca46a96721dbb3e6982d1833985dc4342ec17b9c1e7dfefa7cb4">+5/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
2025-06-10 13:46:09 +02:00
robertkasza
b50404566f feat (dashboard): Add logs view to deployment page (#3352)
### **PR Type**
Enhancement, Documentation


___

### **Description**
- Add logs view to deployment page

- Refactor logs components for reusability

- Improve log filtering and service selection

- Update GraphQL queries and fragments


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>22
files</summary><table>
<tr>
<td><strong>LogsRegexFilter.tsx</strong><dd><code>Add reusable
LogsRegexFilter component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-349fe23e29895116a6e03cd9277c455860af99f3690cc267b2cc7a07628c2530">+87/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>index.ts</strong><dd><code>Export LogsRegexFilter
component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-7fa93132c67731a94b80233a459cab4e83f6c9f3f5adaa21661876bc4c4240bd">+1/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>LogsServiceFilter.tsx</strong><dd><code>Add reusable
LogsServiceFilter component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-a590a7298a9f040df9f26c4eb37d10fc36f47c32996f71aec47796f08c44e892">+69/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>index.ts</strong><dd><code>Export LogsServiceFilter
component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-e75bdc4d69b5725a63a6867b58a41fe4a9892d20c528f91382342959954e6ec7">+1/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>DeploymentDetails.tsx</strong><dd><code>Create
DeploymentDetails component with logs view</code>&nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-e95736b80d6545cd9bab82a81263adef8e9c39f8428eae50420e4b65339b774b">+161/-0</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>DeploymentInfo.tsx</strong><dd><code>Add DeploymentInfo
component for log timestamps</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-37a0e29e73146c3434fe95b0aa93b93f51db32211b2f2646e7248f7ac2dce1a6">+38/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>DeploymentServiceLogs.tsx</strong><dd><code>Implement
DeploymentServiceLogs component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-333a9783713e9a4bad1b5327e117cbe69148091abe8b9038d36132b5f4635bbe">+59/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>DeploymentServiceLogsHeader.tsx</strong><dd><code>Create
DeploymentServiceLogsHeader component</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-4f102c06ed32bb3d8245e415e76b0b14d2d4ae3abca6e234edf69278325c7a95">+81/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>index.tsx</strong><dd><code>Export DeploymentServiceLogs
component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-acd5fadae2f4f5f8a9de9717237d93ada3da2c3502bda78cfab123b9b8b4e8f3">+1/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>index.ts</strong><dd><code>Export useDeployment
hook</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-d45a44082ae4d2d5148c908d077ff69b69cf6ebcd8389e21f5381842cd1896f5">+1/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useDeployment.ts</strong><dd><code>Implement useDeployment
hook</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-e733d29eeab1252ca05a48aa009938205b5f9b0b5e3f90535b6159c1e7ec9137">+59/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>index.ts</strong><dd><code>Export useProjectLogs
hook</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-ae67977c734fbd0f10114658db5b715c09eb8cfe5ae720a96ae7692905e9071e">+2/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useProjectLogs.ts</strong><dd><code>Implement useProjectLogs
hook</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-10efc67700b3f024dd03442eacd339802e951696d04caa76bd5a864bd5c7c83f">+122/-0</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>LogsBody.tsx</strong><dd><code>Update LogsBody
component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-b628e511a7fb9b237ac691b27ab9585eed0d0803144cde66c3af7fa6f9a2dc40">+49/-31</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>LogsHeader.tsx</strong><dd><code>Refactor LogsHeader
component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-ebb3285aa776c9c5ea8b72672c4aafd55994c6c694998bbf56ca9c56d1e77664">+12/-125</a></td>

</tr>

<tr>
<td><strong>LogsServiceFilter.tsx</strong><dd><code>Remove
LogsServiceFilter component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-52634b3870eb08646192600c3ec6bb2737750327dcfa5c08435d99a108fb057c">+0/-29</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>LogsRangeSelector.tsx</strong><dd><code>Update
LogsRangeSelector component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-46dd7c795a79e4b443213ed10089651423d13e5c776ca72e3a95ae5e0f7f63c8">+14/-11</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>services.ts</strong><dd><code>Add custom templates fetcher
service</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-8fcdaed33322718091b613ae22c65cc3eb61972904b5af46866b160c9bbbe48c">+2/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>[deploymentId].tsx</strong><dd><code>Update deployment
details page</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-fbf95e7970ecb8157795fe4d1803c6913b1ba78183fa8a9b0ca9b9e4e9eccba2">+3/-144</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>logs.tsx</strong><dd><code>Refactor logs page to use new
hooks</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-77489a68a7526d74f06d59019ad68c44728b7620637308d70fba38d6649b73fa">+9/-119</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>graphql.ts</strong><dd><code>Update generated GraphQL
types</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-fbd5db84b560b1c91675004448c6c7fa0dcbfb28b9eb05d53b03e6cb7b83ebac">+75/-23</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>deployments.graphql</strong><dd><code>Update GraphQL queries
and fragments</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-c8c4668b1999c73e78eb706631ce9d0e0e41debf66e616350436af4ae3095b76">+31/-22</a>&nbsp;
</td>

</tr>

</table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>3
files</summary><table>
<tr>
<td><strong>useDeployment.test.ts</strong><dd><code>Add tests for
useDeployment hook</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-37c7c86c6c93931c8794f241db0605267d1a051786972c1ab763ca0fe94f2b2b">+183/-0</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>updateQuery.test.ts</strong><dd><code>Add tests for
updateQuery function</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-9eeaaad41f9097bab3be3769f17e4de74c642d5a2313899df3663e1bd3856b30">+324/-0</a>&nbsp;
</td>

</tr>

<tr>
<td><strong>useProjectLogs.test.ts</strong><dd><code>Add tests for
useProjectLogs hook</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3352/files#diff-13d900aa08d06962a09628136b893801ad62a96c3ff89d380c5c4b7ae92d891e">+328/-0</a>&nbsp;
</td>

</tr>
</table></details></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
2025-06-10 12:01:45 +02:00
Emory Mercera
8caf3daa54 Improve sentence flow of paragraph. (#3359)
Improve sentence flow of paragraph.
2025-06-10 11:08:27 +02:00
Calvin
8a07613cbe fix(examples/docker-compose): fix postgres persistent data storage path (#3346) 2025-06-10 11:08:21 +02:00
David BM
736862c9cc fix (dashboard): update link to base directory docs in git settings (#3358)
### **PR Type**
Bug fix


___

### **Description**
- Update link to base directory docs in git settings

- Correct URL for base directory documentation


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug
fix</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>BaseDirectorySettings.tsx</strong><dd><code>Update Base
Directory Documentation Link</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>


dashboard/src/features/orgs/projects/git/settings/components/BaseDirectorySettings/BaseDirectorySettings.tsx

<li>Updated <code>docsLink</code> prop with correct URL for base
directory <br>documentation


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3358/files#diff-50bcccdf949a19ce69fa86acdd63b5291fa2beaba07191a62c87d40ea5b94e88">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Documentation</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>rich-cups-nail.md</strong><dd><code>Add Changeset for
Documentation Link Update</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>

.changeset/rich-cups-nail.md

<li>Added changeset file for minor version bump<br> <li> Described fix
for updating base directory docs link


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3358/files#diff-d085c64fa4e5869bd8d8aa20ef902840240daf6463c463f5a2ae9001932e961b">+5/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
2025-06-06 16:12:41 +02:00
Nuno Pato
ea99fb31d7 chore: dashboard: improve messaging then git connected (#3348)
### **PR Type**
Enhancement, Documentation


___

### **Description**
- Improved GitHub connection messaging in SettingsLayout

- Updated DataBrowserSidebar for GitHub-connected projects

- Added 'graphite' to READ_ONLY_SCHEMAS list

- Created changeset for dashboard version bump


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>SettingsLayout.tsx</strong><dd><code>Redesign GitHub
connection alert in SettingsLayout</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

dashboard/src/features/orgs/layout/SettingsLayout/SettingsLayout.tsx

<li>Redesigned GitHub connection alert<br> <li> Changed alert severity
from warning to info<br> <li> Improved text content and styling<br> <li>
Added link to configuration overlays documentation


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3348/files#diff-aa21cda513a125d8cefc5e7b5e1c755128aa904657350abf0ce1cde21e27ca75">+36/-30</a>&nbsp;
</td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>DataBrowserSidebar.tsx</strong><dd><code>Update GitHub
connection message in DataBrowserSidebar</code>&nbsp; &nbsp; &nbsp;
</dd></summary>
<hr>


dashboard/src/features/orgs/projects/database/dataGrid/components/DataBrowserSidebar/DataBrowserSidebar.tsx

<li>Updated GitHub connection message in DataBrowserSidebar<br> <li>
Simplified text and added InfoIcon<br> <li> Improved layout and styling
of the message


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3348/files#diff-3a9ff7af4a31fbf7e501a77399b2b35306d9e635b021c93f1bc13fc4e225219c">+5/-7</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>common.ts</strong><dd><code>Add 'graphite' to
READ_ONLY_SCHEMAS constant</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

dashboard/src/utils/constants/common/common.ts

- Added 'graphite' to READ_ONLY_SCHEMAS list


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3348/files#diff-91900e60832d94013a6834c72bb53bb89419ad2412d9f46aa16b60ff4090d0a6">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Documentation</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>rich-pillows-teach.md</strong><dd><code>Add changeset
for dashboard version bump</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

.changeset/rich-pillows-teach.md

<li>Created changeset file for minor version bump<br> <li> Added
description of changes for @nhost/dashboard


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3348/files#diff-80c4d9304d4ac2cca6acd40a4909dd85be2d333b64c3a8a25d84bfa6201d9122">+5/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>

---------

Co-authored-by: robertkasza <167509084+robertkasza@users.noreply.github.com>
2025-06-05 21:01:23 +00:00
github-actions[bot]
70433187cc chore: update versions (#3355)
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.12.0

### Minor Changes

-   39b10a2: feat (dashboard): Add multi-factor authentication

## @nhost/react@3.11.0

### Minor Changes

-   39b10a2: feat (dashboard): Add multi-factor authentication
-   4b84780: feat (dashboard): Add Webauthn to dashboard

### Patch Changes

-   @nhost/nhost-js@3.2.9

## @nhost/apollo@8.0.9

### Patch Changes

-   @nhost/nhost-js@3.2.9

## @nhost/react-apollo@18.0.0

### Patch Changes

-   Updated dependencies [39b10a2]
-   Updated dependencies [4b84780]
    -   @nhost/react@3.11.0
    -   @nhost/apollo@8.0.9

## @nhost/react-urql@15.0.0

### Patch Changes

-   Updated dependencies [39b10a2]
-   Updated dependencies [4b84780]
    -   @nhost/react@3.11.0

## @nhost/nextjs@2.2.8

### Patch Changes

-   Updated dependencies [39b10a2]
-   Updated dependencies [4b84780]
    -   @nhost/react@3.11.0

## @nhost/nhost-js@3.2.9

### Patch Changes

-   Updated dependencies [39b10a2]
    -   @nhost/hasura-auth-js@2.12.0

## @nhost/vue@2.9.6

### Patch Changes

-   @nhost/nhost-js@3.2.9

## @nhost/dashboard@2.31.0

### Minor Changes

-   39b10a2: feat (dashboard): Add multi-factor authentication
-   4b84780: feat (dashboard): Add Webauthn to dashboard

### Patch Changes

-   61eb6cd: fix (dashboard): Fix update project e2e test
    -   @nhost/react-apollo@18.0.0
    -   @nhost/nextjs@2.2.8

## @nhost-examples/cli@0.3.22

### Patch Changes

-   @nhost/nhost-js@3.2.9

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

### Patch Changes

-   Updated dependencies [39b10a2]
-   Updated dependencies [4b84780]
    -   @nhost/react@3.11.0
    -   @nhost/react-apollo@18.0.0

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

### Patch Changes

-   Updated dependencies [39b10a2]
-   Updated dependencies [4b84780]
    -   @nhost/react@3.11.0

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

### Patch Changes

-   Updated dependencies [39b10a2]
-   Updated dependencies [4b84780]
    -   @nhost/react@3.11.0
    -   @nhost/react-urql@15.0.0

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

### Patch Changes

-   @nhost/nhost-js@3.2.9

## @nhost-examples/nextjs@0.4.8

### Patch Changes

-   Updated dependencies [39b10a2]
-   Updated dependencies [4b84780]
    -   @nhost/react@3.11.0
    -   @nhost/react-apollo@18.0.0
    -   @nhost/nextjs@2.2.8

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

### Patch Changes

-   @nhost/nhost-js@3.2.9

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

### Patch Changes

-   @nhost/nhost-js@3.2.9

## @nhost-examples/sveltekit@0.8.1

### Patch Changes

-   @nhost/nhost-js@3.2.9

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

### Patch Changes

-   Updated dependencies [39b10a2]
-   Updated dependencies [4b84780]
    -   @nhost/react@3.11.0
    -   @nhost/react-apollo@18.0.0

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

### Patch Changes

-   Updated dependencies [39b10a2]
-   Updated dependencies [4b84780]
    -   @nhost/react@3.11.0

## @nhost-examples/react-native@0.1.9

### Patch Changes

-   Updated dependencies [39b10a2]
-   Updated dependencies [4b84780]
    -   @nhost/react@3.11.0
    -   @nhost/react-apollo@18.0.0

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

### Patch Changes

-   @nhost/nhost-js@3.2.9
-   @nhost/apollo@8.0.9
-   @nhost/vue@2.9.6

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

### Patch Changes

-   @nhost/apollo@8.0.9
-   @nhost/vue@2.9.6

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-06-05 12:39:48 +02:00
robertkasza
39b10a2e9f feat (dashboard): Add mfa (#3342)
### **PR Type**
Enhancement


___

### **Description**
- Add multi-factor authentication (MFA) to dashboard

- Implement MFA OTP form and QR code generation

- Create MFA settings and activation components

- Update sign-in process to support MFA


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>19
files</summary><table>
<tr>
<td><strong>MfaOtpForm.tsx</strong><dd><code>Create reusable MFA OTP
form component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-88ee3610a0658d5eead85db025a5e91e74a4d2f2a836adf7eb44ff80888a613b">+61/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>index.ts</strong><dd><code>Export MfaOtpForm
component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-9c1deb50c3a92ca5494be705635984a97e1b41b07cd0847168a4eeddf0e375d0">+1/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>AccountMfaSettings.tsx</strong><dd><code>Implement MFA
settings component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-4eb33e0f23780eaf93fd7d86850b263d83b05dc2d7a3f6ed9e30d1ca811f17af">+32/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>GenerateMfaQRCodeButton.tsx</strong><dd><code>Create button
to generate MFA QR code</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-7310648a5e879bb76ba6c3136fe555ed3bbdacddc33eef4ce8fc9c21a547ec82">+50/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>MfaQRCode.tsx</strong><dd><code>Implement MFA QR code
generation component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-0c60d61f12b47e421c67c389c66399da76af4b32241610fe94c6635353e57da2">+49/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>useActivateMfa.ts</strong><dd><code>Create hook for MFA
activation</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-0ae70fc9df5a3a6828f7a266db8036107ce9ea705cd318d3a1c4b7304d8522ba">+46/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>useMfaEnabled.ts</strong><dd><code>Create hook to check MFA
status</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-31d2af339a8dd32beff8cce79962fa0dd23b6c89687b21aa75663ebeccb0b154">+17/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>index.ts</strong><dd><code>Export AccountMfaSettings
component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-8c530fc016dd3569f2b7ec7e9085b99c99922ed077357bec562b8c9acaead24a">+1/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>SecurityKeyList.tsx</strong><dd><code>Update import path for
useGetSecurityKeys</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-966a157d381be33bc876e76b28f804e80cae6edb1aa088e78f883063966be3ba">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useOnAddNewSecurityKeyHandler.ts</strong><dd><code>Update
import paths for hooks</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-3514a6d1514269a83f37fc25e9cb24add9d5d74f9cf3341293c0e0f2a4c2e286">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useRemoveSecurityKey.ts</strong><dd><code>Update import
paths for hooks</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-5683e00a14f39018d8fe58a3116c2a8ea6d2f2a83abb2177bbf0ee8ddf0f97b5">+2/-2</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
<td><strong>useElevatedPermissions.ts</strong><dd><code>Create hook for
elevated permissions</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-c1e4f573300c771149cc2e59918c9acf2ae5f8a6680800a899707c70800ba144">[link]</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>useGetSecurityKeys.ts</strong><dd><code>Create hook to fetch
security keys</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-1f9fed870cab61f15e304342e4913edab0f5537eeb6230070de4b4f7173fa138">[link]</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>MfaSignInOtpForm.tsx</strong><dd><code>Create MFA sign-in
OTP form component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-91eba232beb0543b1e972ed9a21a0be797ed94b720487834bb3316a5dbd732f5">+26/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>SignInWithEmailAndPassword.tsx</strong><dd><code>Update
sign-in component to support MFA</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-a2b70644663baf4f6f2cdffd846d4d743a5ca1f2a64c4b278b6f04c6c5c92161">+16/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>

<td><strong>SignInWithEmailAndPasswordForm.tsx</strong><dd><code>Implement
sign-in form with MFA support</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-a07fd6bd20c97d0c9c875e690cd3a80068fc58f74d3579feb210e189d32f5031">+91/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>

<td><strong>useOnSignInWithEmailAndPasswordHandler.ts</strong><dd><code>Create
hook for sign-in with MFA</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-1a253bfc02c3267ab1c6b58c07aa06142b7e711d613b672c8420ff2861b12d27">+56/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>

<td><strong>useSignInWithEmailAndPasswordForm.ts</strong><dd><code>Create
hook for sign-in form validation</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-b908e474c0fb54db9c922d9fef7cf1ef6c4ccb0dd7519da0c45a18e5bb26ed40">+30/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
<td><strong>index.ts</strong><dd><code>Export SignInWithEmailAndPassword
component</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-d3fd195b5ca8ece9eac446129e8501793e5bd6e5c167ed36c8c6d0adc1723fda">+1/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></details></td></tr><tr><td><strong>Additional
files</strong></td><td><details><summary>8 files</summary><table>
<tr>
  <td><strong>mighty-onions-crash.md</strong></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-834d585225de297c20c9e325a231c6d3a72227fc1d8cc84b0c1f8fe0dbb1c523">+7/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td><strong>getActiveMfaType.gql</strong></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-ac5aa6c409363b550d15aace147448c5e267a3cf0fb7f86faf5060f8cbe35302">+5/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td><strong>index.tsx</strong></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-61a48d15d3a2e29160a6d91cd01501ac94cf9f70995c6a84fbb6d6e2c2d4fca1">+4/-0</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td><strong>email.tsx</strong></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-b5d7db4460066bc114cb766771612d6f908bd6e440f40de98e4ac311a26b50cd">+16/-152</a></td>

</tr>

<tr>
  <td><strong>graphql.ts</strong></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-fbd5db84b560b1c91675004448c6c7fa0dcbfb28b9eb05d53b03e6cb7b83ebac">+80/-35</a>&nbsp;
</td>

</tr>

<tr>
  <td><strong>enable-mfa.ts</strong></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-8ed0174991b707a5c54f54ec881656403b4409cd0e3d7004045a80dbeb7b4444">+1/-4</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td><strong>index.ts</strong></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-1cee8646d2cfba37d6ce6a6e9a8d16f8caba0b99fc3a1ad0cb997ed8c7384d2e">+7/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td><strong>useSignInEmailPassword.ts</strong></td>
<td><a
href="https://github.com/nhost/nhost/pull/3342/files#diff-107884d4022cd6c01459f001fa97d2b2ce11566a2c88c8deaec4727c1af44aba">+6/-8</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></details></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
2025-06-05 11:38:49 +02:00
robertkasza
4b8478004e feat (dashboard): Add Webauthn to dashboard (#3320) 2025-06-05 10:28:42 +02:00
robertkasza
61eb6cdc2d fix (dashboard): fix e2e test (#3354)
### **PR Type**
Bug fix, Tests


___

### **Description**
- Refactored e2e test for project upgrade

- Removed unnecessary 'await' keywords

- Added step to save payment information

- Commented out local dashboard image build and tests


___



### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>upgrade-project.test.ts</strong><dd><code>Refactor and
enhance upgrade project e2e test</code>&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

dashboard/e2e/upgrade-project/upgrade-project.test.ts

<li>Removed redundant 'await' keywords<br> <li> Added step to save
payment information<br> <li> Simplified assertions and variable
assignments<br> <li> Minor code cleanup and formatting


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3354/files#diff-8bafbe707eb1dff0c5ae24d6b0a514ff6e80889237de6c89ec330a93be138a12">+18/-16</a>&nbsp;
</td>

</tr>
</table></td></tr><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>ci.yaml</strong><dd><code>Modify CI workflow to focus
on specific tests</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

.github/workflows/ci.yaml

<li>Commented out local dashboard image build step<br> <li> Removed
Nhost CLI installation and local tests<br> <li> Disabled general e2e
tests run


</details>


  </td>
<td><a
href="https://github.com/nhost/nhost/pull/3354/files#diff-944291df2c9c06359d37cc8833d182d705c9e8c3108e7cfe132d61a06e9133dd">+21/-21</a>&nbsp;
</td>

</tr>
</table></td></tr></tr></tbody></table>

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
2025-06-05 09:17:46 +02:00
288 changed files with 7194 additions and 2177 deletions

View File

@@ -11,20 +11,9 @@
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"moduleResolution": "node",
"target": "ES6",
"target": "ESNext",
"module": "CommonJS",
"lib": [
"es5",
"dom",
"es2015.promise",
"es2015.symbol",
"es2015.iterable",
"es2015.collection",
"es2015.symbol.wellknown",
"es2015.core",
"es2017.object",
"es2017.string"
],
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"resolveJsonModule": true,
"esModuleInterop": true,
"sourceMap": true,
@@ -79,4 +68,4 @@
"**/*/__tests__",
"**/*/__mocks__"
]
}
}

View File

@@ -76,6 +76,13 @@ module.exports = {
],
},
],
'jsx-a11y/label-has-associated-control': [
2,
{
controlComponents: ['Input'],
depth: 3,
},
],
},
overrides: [
{

View File

@@ -1,8 +1,9 @@
import { NhostProvider } from '@/providers/nhost';
import '@fontsource/inter';
import '@fontsource/inter/500.css';
import '@fontsource/inter/700.css';
import { CssBaseline, ThemeProvider } from '@mui/material';
import { NhostClient, NhostProvider } from '@nhost/nextjs';
import { createClient } from '@nhost/nhost-js-beta';
import { NhostApolloProvider } from '@nhost/react-apollo';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { Buffer } from 'buffer';
@@ -58,7 +59,9 @@ export const decorators = [
</NhostApolloProvider>
),
(Story) => (
<NhostProvider nhost={new NhostClient({ subdomain: 'local' })}>
<NhostProvider
nhost={createClient({ subdomain: 'local', region: 'local' })}
>
<Story />
</NhostProvider>
),

View File

@@ -1,5 +1,41 @@
# @nhost/dashboard
## 2.33.0
### Minor Changes
- aee9a80: chore: update typescript version to the latest
- 5ef3f76: chore (dashboard): Use the new SDK in the Dashboard
### Patch Changes
- 9ed8ce8: fix (dashboard): Request new Mfa ticket after an invalid totp when signing in
- fd3b5c7: fix (dashboard): Limit new project's name to a maximum of 32 charachters in E2E tests
## 2.32.0
### Minor Changes
- 736862c: fix: update link to base directory docs in git settings
- ea99fb3: chore: dashboard: improve messaging when git connected
### Patch Changes
- d738884: chore (dashboard): Add link about antivirus integration
## 2.31.0
### Minor Changes
- 39b10a2: feat (dashboard): Add multi-factor authentication
- 4b84780: feat (dashboard): Add Webauthn to dashboard
### Patch Changes
- 61eb6cd: fix (dashboard): Fix update project e2e test
- @nhost/react-apollo@18.0.0
- @nhost/nextjs@2.2.8
## 2.30.0
### Minor Changes

View File

@@ -14,6 +14,7 @@ export const test = base.extend<{ authenticatedNhostPage: Page }>({
);
await use(page);
// update the context to get the new refresh token
await page.waitForLoadState('networkidle');
await page.context().storageState({ path: AUTH_CONTEXT });
await page.close();
},

View File

@@ -24,23 +24,20 @@ test.beforeAll(async ({ browser }) => {
});
test('should create a new project', async () => {
await await gotoUrl(
page,
`/orgs/${getFreeUserStarterOrgSlug()}/projects/new`,
);
const projectName = faker.lorem.words(3);
await gotoUrl(page, `/orgs/${getFreeUserStarterOrgSlug()}/projects/new`);
const projectName = faker.lorem.words(3).slice(0, 32);
await page.getByLabel('Project Name').fill(projectName);
await page.getByText('Create Project').click();
expect(await page.getByText('Creating the project...')).toBeVisible();
expect(await page.getByText('Internal info')).toBeVisible();
expect(page.getByText('Creating the project...')).toBeVisible();
expect(page.getByText('Internal info')).toBeVisible();
await page.waitForSelector('button:has-text("Upgrade project")', {
timeout: 120000,
timeout: 180000,
});
const newProjectSlug = getProjectSlugFromUrl(await page.url());
const newProjectSlug = getProjectSlugFromUrl(page.url());
setNewProjectSlug(newProjectSlug);
setNewProjectName(projectName);
});
@@ -50,7 +47,7 @@ test('should upgrade the project', async () => {
page,
`/orgs/${getFreeUserStarterOrgSlug()}/projects/${getNewProjectSlug()}`,
);
const upgradeProject = await page.getByText('Upgrade project');
const upgradeProject = page.getByText('Upgrade project');
expect(upgradeProject).toBeVisible();
await upgradeProject.click();
@@ -67,10 +64,10 @@ test('should upgrade the project', async () => {
await page.waitForSelector('button:has-text("Create organization")', {
state: 'hidden',
});
const stripeFrame = await page
const stripeFrame = page
.frameLocator('iframe[name="embedded-checkout"]')
.first();
await stripeFrame.getByText('Subscribe to Nhost');
stripeFrame.getByText('Subscribe to Nhost');
await stripeFrame.getByLabel('Email').fill(faker.internet.email());
await stripeFrame
@@ -85,7 +82,7 @@ test('should upgrade the project', async () => {
await stripeFrame.locator('#billingCountry').scrollIntoViewIfNeeded();
// Need to comment out for local testing START
await stripeFrame.getByPlaceholder('Address', { exact: true }).click();
await stripeFrame.locator('span:has-text("Enter address manually")');
stripeFrame.locator('span:has-text("Enter address manually")');
await stripeFrame.getByText('Enter address manually').click();
await stripeFrame
.getByPlaceholder('Address line 1', { exact: true })
@@ -94,6 +91,7 @@ test('should upgrade the project', async () => {
.getByPlaceholder('City', { exact: true })
.fill('Springfield');
await stripeFrame.getByPlaceholder('ZIP', { exact: true }).fill('62701');
await stripeFrame.locator('#enableStripePass').click({ force: true });
// local Comment end
await stripeFrame
.getByTestId('hosted-payment-submit-button')
@@ -110,12 +108,12 @@ test('should upgrade the project', async () => {
'div:has-text("Project has been upgraded successfully!")',
);
await page.getByRole('button', { name: 'Create project' });
page.getByRole('button', { name: 'Create project' });
await page.waitForSelector(`div:has-text("${newOrgName}")`);
await page.waitForSelector(`p:has-text("${getNewProjectName()}")`);
setNewOrgSlug(getOrgSlugFromUrl(await page.url()));
setNewOrgSlug(getOrgSlugFromUrl(page.url()));
});
test('should delete the new organization', async () => {
@@ -126,12 +124,12 @@ test('should delete the new organization', async () => {
await page.getByRole('button', { name: 'Delete' }).click();
await page.waitForSelector('h2:has-text("Delete Organization")');
expect(await page.getByTestId('deleteOrgButton')).toBeDisabled();
expect(page.getByTestId('deleteOrgButton')).toBeDisabled();
await page.getByLabel("I'm sure I want to delete this Organization").click();
expect(await page.getByTestId('deleteOrgButton')).toBeDisabled();
expect(page.getByTestId('deleteOrgButton')).toBeDisabled();
await page.getByLabel('I understand this action cannot be undone').click();
expect(await page.getByTestId('deleteOrgButton')).not.toBeDisabled();
expect(page.getByTestId('deleteOrgButton')).not.toBeDisabled();
await page.getByTestId('deleteOrgButton').click();

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/dashboard",
"version": "2.30.0",
"version": "2.33.0",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
@@ -39,13 +39,13 @@
"@heroicons/react": "^1.0.6",
"@hookform/resolvers": "^3.9.0",
"@iarna/toml": "^2.2.5",
"@icons-pack/react-simple-icons": "^9.6.0",
"@marsidev/react-turnstile": "^1.0.2",
"@mui/base": "5.0.0-beta.31",
"@mui/material": "^5.15.14",
"@mui/system": "^5.15.14",
"@mui/x-date-pickers": "^5.0.20",
"@nhost/nextjs": "workspace:*",
"@nhost/react-apollo": "workspace:*",
"@nhost/nhost-js-beta": "npm:@nhost/nhost-js@5.0.0-beta.7",
"@radix-ui/react-accordion": "^1.2.1",
"@radix-ui/react-alert-dialog": "^1.1.2",
"@radix-ui/react-checkbox": "^1.1.2",
@@ -62,6 +62,7 @@
"@radix-ui/react-tabs": "^1.1.3",
"@radix-ui/react-tooltip": "^1.1.2",
"@segment/analytics-next": "^1.77.0",
"@simplewebauthn/browser": "^9.0.1",
"@stripe/react-stripe-js": "^2.6.2",
"@stripe/stripe-js": "^1.54.2",
"@tailwindcss/forms": "^0.5.7",
@@ -87,6 +88,7 @@
"graphql-tag": "^2.12.6",
"graphql-ws": "^5.16.0",
"just-kebab-case": "^4.2.0",
"jwt-decode": "^4.0.0",
"lodash.debounce": "^4.0.8",
"lucide-react": "^0.416.0",
"next": "^14.2.26",
@@ -107,7 +109,7 @@
"react-is": "18.2.0",
"react-loading-skeleton": "^2.2.0",
"react-markdown": "^9.0.1",
"react-merge-refs": "^1.1.0",
"react-merge-refs": "^3.0.2",
"react-resizable-layout": "^0.7.2",
"react-table": "^7.8.0",
"recoil": "^0.7.7",

View File

@@ -0,0 +1,518 @@
import { render, screen, TestUserEvent, waitFor } from '@/tests/testUtils';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import MfaOtpForm from './MfaOtpForm';
const mocks = vi.hoisted(() => ({
toastError: vi.fn(),
}));
// Mock react-hot-toast
vi.mock('react-hot-toast', async () => {
const actualToast = await vi.importActual<any>('react-hot-toast');
return {
...actualToast,
default: {
...actualToast.default,
error: mocks.toastError,
},
};
});
// Mock the toast style props utility
vi.mock('@/utils/constants/settings', () => ({
getToastStyleProps: vi.fn(() => ({})),
}));
describe('MfaOtpForm', () => {
const mockSendMfaOtp = vi.fn();
const mockRequestNewMfaTicket = vi.fn();
const user = new TestUserEvent();
beforeEach(() => {
vi.clearAllMocks();
});
afterEach(() => {
vi.clearAllTimers();
});
const defaultProps = {
sendMfaOtp: mockSendMfaOtp,
loading: false,
requestNewMfaTicket: mockRequestNewMfaTicket,
} as any;
describe('Rendering and Initial State', () => {
it('renders with correct initial state', () => {
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
expect(input).toBeInTheDocument();
expect(input).toHaveValue('');
expect(button).toBeInTheDocument();
expect(button).toBeDisabled();
});
it('focuses input on mount', () => {
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
expect(input).toHaveFocus();
});
});
describe('Input Validation and Formatting', () => {
it('only accepts numeric characters', async () => {
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
await user.type(input, 'abc123def456');
expect(input).toHaveValue('123456');
});
it('filters out non-numeric characters in real time', async () => {
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
await user.type(input, '1a2b3c');
expect(input).toHaveValue('123');
});
it('button is disabled when input has fewer than 6 digits', async () => {
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '12345');
expect(button).toBeDisabled();
});
it('button is enabled when input has exactly 6 digits', async () => {
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '123456');
expect(button).toBeEnabled();
});
it('button is disabled when input has more than 6 digits', async () => {
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '6123457');
expect(button).toBeDisabled();
});
});
describe('Loading States', () => {
it('disables input and button when loading prop is true', () => {
render(<MfaOtpForm {...defaultProps} loading />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button');
expect(input).toBeDisabled();
expect(button).toBeDisabled();
expect(
screen.getByRole('button', { name: 'Verifying...' }),
).toBeInTheDocument();
});
it('input and button are disabled during submission', async () => {
// Mock sendMfaOtp to return a promise that we can control
const promise = new Promise(() => {}); // Never resolves
mockSendMfaOtp.mockReturnValue(promise);
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '123456');
await user.click(button);
expect(input).toBeDisabled();
expect(button).toBeDisabled();
});
});
describe('Form Submission', () => {
it('triggers sendMfaOtp with correct code on button click', async () => {
mockSendMfaOtp.mockResolvedValue({ success: true });
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '123456');
await user.click(button);
expect(mockSendMfaOtp).toHaveBeenCalledWith('123456');
expect(mockSendMfaOtp).toHaveBeenCalledTimes(1);
});
it('does not submit when input has fewer than 6 digits', async () => {
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '12345');
await user.click(button);
expect(mockSendMfaOtp).not.toHaveBeenCalled();
});
it('does not submit multiple times when already submitting', async () => {
let resolvePromise: (value: any) => void;
const promise = new Promise((resolve) => {
resolvePromise = resolve;
});
mockSendMfaOtp.mockReturnValue(promise);
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '123456');
await user.click(button);
await user.click(button); // Second click should be ignored
expect(mockSendMfaOtp).toHaveBeenCalledTimes(1);
// Resolve the promise to clean up
resolvePromise!({ success: true });
await waitFor(async () => {
await promise;
});
});
it('manages submission state properly', async () => {
let resolvePromise: (value: any) => void;
const promise = new Promise((resolve) => {
resolvePromise = resolve;
});
mockSendMfaOtp.mockReturnValue(promise);
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '123456');
await user.click(button);
// During submission
expect(button).toBeDisabled();
expect(input).toBeDisabled();
// Resolve the promise
resolvePromise!({ success: true });
await waitFor(async () => {
await promise;
});
// After submission
await waitFor(() => {
expect(button).not.toBeDisabled();
expect(input).not.toBeDisabled();
});
});
});
describe('Error Handling', () => {
it('displays error toast when sendMfaOtp returns an error', async () => {
const errorMessage = 'Invalid TOTP code';
mockSendMfaOtp.mockRejectedValueOnce({ message: errorMessage });
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '123456');
await user.click(button);
await waitFor(() => {
expect(mocks.toastError).toHaveBeenCalledWith(errorMessage, {});
});
});
it('shows generic error message when no specific error message is provided', async () => {
mockSendMfaOtp.mockRejectedValueOnce({});
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '123456');
await user.click(button);
await waitFor(() => {
expect(mocks.toastError).toHaveBeenCalledWith(
'An error occurred. Please try again.',
{},
);
});
});
it('handles undefined error gracefully', async () => {
mockSendMfaOtp.mockResolvedValue({
error: undefined,
});
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '123456');
await user.click(button);
// Should not throw an error
await waitFor(() => {
expect(mockSendMfaOtp).toHaveBeenCalled();
});
});
});
describe('MFA Ticket Renewal', () => {
it('calls requestNewMfaTicket when ticket is invalid', async () => {
// First call - set ticket as invalid
mockSendMfaOtp.mockRejectedValueOnce({ message: 'Invalid ticket' });
// Second call - should work
mockSendMfaOtp.mockResolvedValueOnce({ success: true });
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
// First submission - creates error and marks ticket invalid
await user.type(input, '123456');
await user.click(button);
await waitFor(() => {
expect(mocks.toastError).toHaveBeenCalled();
});
// Clear input and try again
await user.clear(input);
await user.type(input, '654321');
await user.click(button);
await waitFor(() => {
expect(mockRequestNewMfaTicket).toHaveBeenCalled();
});
});
it('does not call requestNewMfaTicket on first submission', async () => {
mockSendMfaOtp.mockResolvedValue({ success: true });
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '123456');
await user.click(button);
expect(mockRequestNewMfaTicket).not.toHaveBeenCalled();
});
it('works correctly when requestNewMfaTicket is not provided', async () => {
const propsWithoutTicketRenewal = {
sendMfaOtp: mockSendMfaOtp,
loading: false,
} as any;
mockSendMfaOtp.mockRejectedValueOnce({ message: 'Some error' });
render(<MfaOtpForm {...propsWithoutTicketRenewal} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '123456');
await user.click(button);
// Should not throw an error even without requestNewMfaTicket
await waitFor(() => {
expect(mocks.toastError).toHaveBeenCalled();
});
});
});
describe('User Interactions', () => {
it('updates input value correctly when typing', async () => {
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
await user.type(input, '123');
expect(input).toHaveValue('123');
await user.type(input, '456');
expect(input).toHaveValue('123456');
});
it('can clear and retype input value', async () => {
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
await user.type(input, '123456');
expect(input).toHaveValue('123456');
await user.clear(input);
expect(input).toHaveValue('');
await user.type(input, '654321');
expect(input).toHaveValue('654321');
});
it('button triggers submission with valid code', async () => {
mockSendMfaOtp.mockResolvedValue({ success: true });
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '123456');
await user.click(button);
expect(mockSendMfaOtp).toHaveBeenCalledWith('123456');
});
it('submits form when pressing Enter key with valid code', async () => {
mockSendMfaOtp.mockResolvedValue({ success: true });
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
await user.type(input, '123456');
await user.type(input, '{Enter}');
expect(mockSendMfaOtp).toHaveBeenCalledWith('123456');
expect(mockSendMfaOtp).toHaveBeenCalledTimes(1);
});
it('does not submit when pressing Enter with invalid code length', async () => {
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
await user.type(input, '12345');
await user.type(input, '{Enter}');
expect(mockSendMfaOtp).not.toHaveBeenCalled();
});
it('does not submit when pressing Enter while loading', async () => {
render(<MfaOtpForm {...defaultProps} loading />);
const input = screen.getByPlaceholderText('Enter TOTP');
await user.type(input, '123456');
await user.type(input, '{Enter}');
expect(mockSendMfaOtp).not.toHaveBeenCalled();
});
it('does not submit multiple times when pressing Enter while submitting', async () => {
let resolvePromise: (value: any) => void;
const promise = new Promise((resolve) => {
resolvePromise = resolve;
});
mockSendMfaOtp.mockReturnValue(promise);
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
await user.type(input, '123456');
await user.type(input, '{Enter}');
await user.type(input, '{Enter}'); // Second Enter should be ignored
expect(mockSendMfaOtp).toHaveBeenCalledTimes(1);
// Clean up
resolvePromise!({ success: true });
await waitFor(async () => {
await promise;
});
});
});
describe('Edge Cases', () => {
it('handles null error message gracefully', async () => {
mockSendMfaOtp.mockRejectedValueOnce({ message: null });
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '123456');
await user.click(button);
await waitFor(() => {
expect(mocks.toastError).toHaveBeenCalledWith(
'An error occurred. Please try again.',
{},
);
});
});
it('prevents multiple rapid submissions', async () => {
let resolvePromise: (value: any) => void;
const promise = new Promise((resolve) => {
resolvePromise = resolve;
});
mockSendMfaOtp.mockReturnValue(promise);
render(<MfaOtpForm {...defaultProps} />);
const input = screen.getByPlaceholderText('Enter TOTP');
const button = screen.getByRole('button', { name: 'Verify' });
await user.type(input, '123456');
// Rapid clicks
await user.click(button);
await user.click(button);
await user.click(button);
expect(mockSendMfaOtp).toHaveBeenCalledTimes(1);
// Clean up
resolvePromise!({ success: true });
await waitFor(async () => {
await promise;
});
});
it('handles empty input correctly', async () => {
render(<MfaOtpForm {...defaultProps} />);
const button = screen.getByRole('button', { name: 'Verify' });
await user.click(button);
expect(mockSendMfaOtp).not.toHaveBeenCalled();
expect(button).toBeDisabled();
});
});
});

View File

@@ -0,0 +1,87 @@
import { Button } from '@/components/ui/v3/button';
import { Input } from '@/components/ui/v3/input';
import { getToastStyleProps } from '@/utils/constants/settings';
import {
useEffect,
useRef,
useState,
type ChangeEvent,
type KeyboardEvent,
} from 'react';
import toast from 'react-hot-toast';
interface Props {
sendMfaOtp: (code: string) => Promise<any>;
loading: boolean;
requestNewMfaTicket?: () => Promise<void>;
}
function MfaOtpForm({ sendMfaOtp, loading, requestNewMfaTicket }: Props) {
const [otpValue, setOtpValue] = useState<string>('');
const [isSubmitting, setIsSubmitting] = useState<boolean>(false);
const inputRef = useRef<HTMLInputElement | null>(null);
const isMfaTicketInvalid = useRef(false);
useEffect(() => {
if (inputRef.current) {
inputRef.current.focus();
}
}, []);
async function submitTOTP() {
if (otpValue.length === 6 && !isSubmitting) {
try {
setIsSubmitting(true);
if (requestNewMfaTicket && isMfaTicketInvalid.current) {
await requestNewMfaTicket();
}
await sendMfaOtp(otpValue);
} catch (error) {
isMfaTicketInvalid.current = true;
toast.error(
error?.message || 'An error occurred. Please try again.',
getToastStyleProps(),
);
setTimeout(() => {
inputRef.current?.focus();
}, 10);
} finally {
setIsSubmitting(false);
}
}
}
async function handleChange(event: ChangeEvent<HTMLInputElement>) {
const code = event.target.value.replace(/[^0-9]/g, '');
setOtpValue(code);
}
async function handleKeyDown(event: KeyboardEvent<HTMLInputElement>) {
if (event.key === 'Enter') {
submitTOTP();
}
}
const isInputDisabled = loading || isSubmitting;
const isButtonDisabled = isInputDisabled || otpValue.length !== 6;
return (
<div className="relative grid w-full grid-flow-row gap-4 bg-transparent">
<Input
ref={inputRef}
value={otpValue}
placeholder="Enter TOTP"
className="!bg-transparent"
disabled={isInputDisabled}
onChange={handleChange}
onKeyDown={handleKeyDown}
/>
<Button disabled={isButtonDisabled} onClick={submitTOTP}>
{loading ? 'Verifying...' : 'Verify'}
</Button>
</div>
);
}
export default MfaOtpForm;

View File

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

View File

@@ -8,7 +8,7 @@ import type { ForwardedRef } from 'react';
import { forwardRef } from 'react';
import type { FieldValues, UseControllerProps } from 'react-hook-form';
import { useController, useFormContext } from 'react-hook-form';
import mergeRefs from 'react-merge-refs';
import { mergeRefs } from 'react-merge-refs';
export interface ControlledAutocompleteProps<
TOption extends AutocompleteOption = AutocompleteOption,

View File

@@ -5,7 +5,7 @@ import type { ForwardedRef } from 'react';
import { forwardRef } from 'react';
import type { FieldValues, UseControllerProps } from 'react-hook-form';
import { useController, useFormContext } from 'react-hook-form';
import mergeRefs from 'react-merge-refs';
import { mergeRefs } from 'react-merge-refs';
export interface ControlledCheckboxProps<TFieldValues extends FieldValues = any>
extends CheckboxProps {
@@ -38,7 +38,7 @@ function ControlledCheckbox(
uncheckWhenDisabled,
...props
}: ControlledCheckboxProps,
ref: ForwardedRef<HTMLInputElement>,
ref: ForwardedRef<HTMLButtonElement>,
) {
const { setValue } = useFormContext();
const { field } = useController({

View File

@@ -4,7 +4,7 @@ import type { ForwardedRef } from 'react';
import { forwardRef } from 'react';
import type { FieldValues, UseControllerProps } from 'react-hook-form';
import { useController, useFormContext } from 'react-hook-form';
import mergeRefs from 'react-merge-refs';
import { mergeRefs } from 'react-merge-refs';
export interface ControlledSelectProps<TFieldValues extends FieldValues = any>
extends SelectProps<TFieldValues> {
@@ -24,7 +24,7 @@ export interface ControlledSelectProps<TFieldValues extends FieldValues = any>
function ControlledSelect(
{ controllerProps, name, control, ...props }: ControlledSelectProps,
ref: ForwardedRef<HTMLInputElement>,
ref: ForwardedRef<HTMLButtonElement>,
) {
const { setValue } = useFormContext();
const { field } = useController({

View File

@@ -2,13 +2,13 @@ import type { SwitchProps } from '@/components/ui/v2/Switch';
import { Switch } from '@/components/ui/v2/Switch';
import type { ForwardedRef } from 'react';
import { forwardRef } from 'react';
import { useController, useFormContext } from 'react-hook-form';
import type {
ControllerProps,
FieldValues,
UseControllerProps,
} from 'react-hook-form/dist/types';
import mergeRefs from 'react-merge-refs';
} from 'react-hook-form';
import { useController, useFormContext } from 'react-hook-form';
import { mergeRefs } from 'react-merge-refs';
export interface ControlledSwitchProps<TFieldValues extends FieldValues = any>
extends SwitchProps {

View File

@@ -0,0 +1,59 @@
import {
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from '@/components/ui/v3/form';
import { Input } from '@/components/ui/v3/input';
import type { Control, FieldPath, FieldValues } from 'react-hook-form';
const inputClasses =
'!bg-transparent aria-[invalid=true]:border-red-500 aria-[invalid=true]:focus:border-red-500 aria-[invalid=true]:focus:ring-red-500';
interface FormInputProps<
TFieldValues extends FieldValues = FieldValues,
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
> {
control: Control<TFieldValues>;
name: TName;
label: string;
placeholder?: string;
className?: string;
type?: string;
}
function FormInput<
TFieldValues extends FieldValues = FieldValues,
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
>({
control,
name,
label,
placeholder,
className = '',
type = 'text',
}: FormInputProps<TFieldValues, TName>) {
return (
<FormField
control={control}
name={name}
render={({ field }) => (
<FormItem>
<FormLabel>{label}</FormLabel>
<FormControl>
<Input
type={type}
placeholder={placeholder || label}
{...field}
className={`${inputClasses} ${className}`}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
);
}
export default FormInput;

View File

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

View File

@@ -6,19 +6,24 @@ import { Button } from '@/components/ui/v2/Button';
import { Divider } from '@/components/ui/v2/Divider';
import { Dropdown, useDropdown } from '@/components/ui/v2/Dropdown';
import { Text } from '@/components/ui/v2/Text';
import { useUserData } from '@/hooks/useUserData';
import { useAuth } from '@/providers/Auth';
import { useApolloClient } from '@apollo/client';
import { useSignOut, useUserData } from '@nhost/nextjs';
import getConfig from 'next/config';
import { useRouter } from 'next/router';
function AccountMenuContent() {
const user = useUserData();
const { signOut } = useSignOut();
const router = useRouter();
const { signout } = useAuth();
const apolloClient = useApolloClient();
const { handleClose } = useDropdown();
const { publicRuntimeConfig } = getConfig();
async function handleSignOut() {
handleClose();
await apolloClient.clearStore();
await signout();
}
return (
<Box className="grid grid-flow-row">
<Box className="grid grid-flow-col items-center justify-start gap-3 p-4">
@@ -70,12 +75,7 @@ function AccountMenuContent() {
color="error"
variant="borderless"
className="w-full justify-start"
onClick={async () => {
handleClose();
await apolloClient.clearStore();
await signOut();
await router.push('/signin');
}}
onClick={handleSignOut}
>
Sign out
</Button>

View File

@@ -2,22 +2,23 @@ import type { BaseLayoutProps } from '@/components/layout/BaseLayout';
import { BaseLayout } from '@/components/layout/BaseLayout';
import { Container } from '@/components/layout/Container';
import { Header } from '@/components/layout/Header';
import { MainNav } from '@/components/layout/MainNav';
import { useTreeNavState } from '@/components/layout/MainNav/TreeNavStateContext';
import { HighlightedText } from '@/components/presentational/HighlightedText';
import { RetryableErrorBoundary } from '@/components/presentational/RetryableErrorBoundary';
import { ActivityIndicator } from '@/components/ui/v2/ActivityIndicator';
import { Link } from '@/components/ui/v2/Link';
import { Text } from '@/components/ui/v2/Text';
import { useIsPlatform } from '@/features/orgs/projects/common/hooks/useIsPlatform';
import { useAuthenticationStatus } from '@nhost/nextjs';
import Analytics from '@/components/analytics/analytics';
import { useMediaQuery } from '@/components/common/useMediaQuery';
import { MainNav } from '@/components/layout/MainNav';
import PinnedMainNav from '@/components/layout/MainNav/PinnedMainNav';
import { useTreeNavState } from '@/components/layout/MainNav/TreeNavStateContext';
import { RetryableErrorBoundary } from '@/components/presentational/RetryableErrorBoundary';
import { OrgStatus } from '@/features/orgs/components/OrgStatus';
import { useIsHealthy } from '@/features/orgs/projects/common/hooks/useIsHealthy';
import { useNotFoundRedirect } from '@/features/orgs/projects/common/hooks/useNotFoundRedirect';
import { cn } from '@/lib/utils';
import { useAuth } from '@/providers/Auth';
import Image from 'next/image';
import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';
@@ -32,7 +33,7 @@ export default function AuthenticatedLayout({
const isPlatform = useIsPlatform();
const isMdOrLarger = useMediaQuery('md');
const { isAuthenticated, isLoading } = useAuthenticationStatus();
const { isAuthenticated, isLoading } = useAuth();
const isHealthy = useIsHealthy();
const [mainNavContainer, setMainNavContainer] = useState(null);
const { mainNavPinned } = useTreeNavState();
@@ -43,7 +44,6 @@ export default function AuthenticatedLayout({
if (!isPlatform || isLoading || isAuthenticated) {
return;
}
router.push('/signin');
}, [isLoading, isAuthenticated, router, isPlatform]);
@@ -65,11 +65,15 @@ export default function AuthenticatedLayout({
if (isPlatform && isLoading) {
return (
<BaseLayout className="h-full" {...props}>
<Header className="flex max-h-[59px] flex-auto" />
<Header className="flex max-h-[59px] flex-auto py-1" />
</BaseLayout>
);
}
// if (isPlatform && !isLoading && !isAuthenticated) {
// return null;
// }
if (!isPlatform && !isHealthy) {
return (
<BaseLayout className="h-full" {...props}>
@@ -142,6 +146,7 @@ export default function AuthenticatedLayout({
>
<div className="flex h-full w-full flex-col overflow-auto">
<OrgStatus />
<Analytics />
{children}
</div>
</RetryableErrorBoundary>

View File

@@ -10,8 +10,8 @@ import { List } from '@/components/ui/v2/List';
import { ListItem } from '@/components/ui/v2/ListItem';
import { Text } from '@/components/ui/v2/Text';
import { useIsPlatform } from '@/features/orgs/projects/common/hooks/useIsPlatform';
import { useAuth } from '@/providers/Auth';
import { useApolloClient } from '@apollo/client';
import { useSignOut } from '@nhost/nextjs';
import getConfig from 'next/config';
import { useRouter } from 'next/router';
import { useState } from 'react';
@@ -22,11 +22,18 @@ export interface MobileNavProps extends ButtonProps {}
export default function MobileNav({ className, ...props }: MobileNavProps) {
const isPlatform = useIsPlatform();
const [menuOpen, setMenuOpen] = useState(false);
const { signOut } = useSignOut();
const { signout } = useAuth();
const apolloClient = useApolloClient();
const router = useRouter();
const { publicRuntimeConfig } = getConfig();
async function handleSignOut() {
setMenuOpen(false);
await apolloClient.clearStore();
await signout();
await router.push('/signin');
}
return (
<>
<Button
@@ -120,12 +127,7 @@ export default function MobileNav({ className, ...props }: MobileNavProps) {
variant="borderless"
sx={{ color: 'error.main' }}
className="justify-start border-none px-2 py-2.5 text-[16px]"
onClick={async () => {
setMenuOpen(false);
await apolloClient.clearStore();
await signOut();
await router.push('/signin');
}}
onClick={handleSignOut}
>
Sign Out
</ListItem.Button>

View File

@@ -6,8 +6,8 @@ import { RetryableErrorBoundary } from '@/components/presentational/RetryableErr
import { Box } from '@/components/ui/v2/Box';
import { ThemeProvider } from '@/components/ui/v2/ThemeProvider';
import { useIsPlatform } from '@/features/orgs/projects/common/hooks/useIsPlatform';
import { useAuth } from '@/providers/Auth';
import GlobalStyles from '@mui/material/GlobalStyles';
import { useAuthenticationStatus } from '@nhost/nextjs';
import Image from 'next/image';
import { useRouter } from 'next/router';
import { useEffect } from 'react';
@@ -20,7 +20,7 @@ export default function UnauthenticatedLayout({
}: UnauthenticatedLayoutProps) {
const router = useRouter();
const isPlatform = useIsPlatform();
const { isAuthenticated, isLoading } = useAuthenticationStatus();
const { isAuthenticated, isLoading } = useAuth();
const isOnResetPassword = router.route === '/password/reset';
useEffect(() => {

View File

@@ -6,8 +6,8 @@ import {
type ReactElement,
} from 'react';
import { CopyToClipboardButton as CopyToClipboardButtonOriginal } from '@/components/presentational/CopyToClipboardButton';
import { Box } from '@/components/ui/v2/Box';
import { CopyToClipboardButton as CopyToClipboardButtonOriginal } from './CopyToClipboardButton';
import { getNodeText } from './getNodeText';
export interface CodeBlockPropsBase {

View File

@@ -1,14 +1,11 @@
import { Button, type ButtonProps } from '@/components/ui/v3/button';
import { isNotEmptyValue } from '@/lib/utils';
import { copy } from '@/utils/copy';
import { clsx } from 'clsx';
import { Copy } from 'lucide-react';
import { useEffect, useState } from 'react';
import {
IconButton,
type IconButtonProps,
} from '@/components/ui/v2/IconButton';
import { CopyIcon } from '@/components/ui/v2/icons/CopyIcon';
import { copy } from '@/utils/copy';
export function CopyToClipboardButton({
function CopyToClipboardButton({
textToCopy,
className,
title,
@@ -16,7 +13,7 @@ export function CopyToClipboardButton({
}: {
textToCopy: string;
title: string;
} & IconButtonProps) {
} & ButtonProps) {
const [disabled, setDisabled] = useState(true);
useEffect(() => {
@@ -35,12 +32,18 @@ export function CopyToClipboardButton({
if (!textToCopy || disabled) {
return null;
}
const hasChildren = isNotEmptyValue(props.children);
return (
<IconButton
variant="borderless"
color="secondary"
className={clsx('group', className)}
<Button
type="button"
size="icon"
variant="outline"
className={clsx(
'group h-fit w-fit border-0 bg-transparent p-[2px] hover:bg-[#d6eefb] dark:hover:bg-[#1e2942]',
className,
{ 'gap-3': hasChildren },
)}
onClick={(event) => {
event.stopPropagation();
@@ -49,7 +52,9 @@ export function CopyToClipboardButton({
aria-label={textToCopy}
{...props}
>
<CopyIcon className="top-5 h-4 w-4" />
</IconButton>
{props.children}
<Copy className="top-5 h-4 w-4" />
</Button>
);
}
export default CopyToClipboardButton;

View File

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

View File

@@ -92,7 +92,7 @@ function Checkbox(
'aria-label': ariaLabel,
...props
}: CheckboxProps,
ref: ForwardedRef<HTMLInputElement>,
ref: ForwardedRef<HTMLButtonElement>,
) {
if (!label) {
return (

View File

@@ -3,10 +3,10 @@ import { ChevronUpIcon } from '@/components/ui/v2/icons/ChevronUpIcon';
import { CopyIcon } from '@/components/ui/v2/icons/CopyIcon';
import { XIcon } from '@/components/ui/v2/icons/XIcon';
import { useProject } from '@/features/orgs/projects/hooks/useProject';
import { useUserData } from '@/hooks/useUserData';
import { getToastBackgroundColor } from '@/utils/constants/settings';
import { copy } from '@/utils/copy';
import type { ApolloError } from '@apollo/client';
import { useUserData } from '@nhost/nextjs';
import { AnimatePresence, motion } from 'framer-motion';
import { useRouter } from 'next/router';
import { useState } from 'react';

View File

@@ -5,7 +5,7 @@ import type { InputBaseProps as MaterialInputBaseProps } from '@mui/material/Inp
import MaterialInputBase, { inputBaseClasses } from '@mui/material/InputBase';
import type { DetailedHTMLProps, ForwardedRef, HTMLProps } from 'react';
import { forwardRef } from 'react';
import mergeRefs from 'react-merge-refs';
import { mergeRefs } from 'react-merge-refs';
export interface InputProps
extends Omit<MaterialInputBaseProps, 'componentsProps' | 'slotProps'>,

View File

@@ -57,7 +57,7 @@ const StyledRadio = styled(MaterialRadio)(({ theme }) => ({
function Radio(
{ label, value, slotProps, ...props }: RadioProps,
ref: ForwardedRef<HTMLInputElement>,
ref: ForwardedRef<HTMLButtonElement>,
) {
return (
<StyledFormControlLabel

View File

@@ -0,0 +1,44 @@
import { Badge } from '@/components/ui/v3/badge';
import useMfaEnabled from '@/features/account/settings/components/AccountMfaSettings/hooks/useMfaEnabled';
import DisableMfaButton from './DisableMfaButton/DisableMfaButton';
import EnableMfaButton from './EnableMfaButton/EnableMfaButton';
function MFaEnabledBadge() {
return (
<Badge variant="outline" className="border-green-400 text-green-400">
Enabled
</Badge>
);
}
function MFaDisabledBadge() {
return (
<Badge
variant="outline"
className="text- border-destructive text-destructive"
>
Disabled
</Badge>
);
}
function AccountMfaSettings() {
const { isMfaEnabled } = useMfaEnabled();
return (
<div className="rounded-lg border border-[#EAEDF0] bg-white font-['Inter_var'] dark:border-[#2F363D] dark:bg-paper">
<div className="flex w-full flex-col items-start gap-6 p-4">
<div className="flex w-full items-center justify-between">
<h3 className="flex items-center text-[1.125rem] font-semibold leading-[1.75]">
<span className="mr-4">Multi-Factor Authentication </span>
{isMfaEnabled ? <MFaEnabledBadge /> : <MFaDisabledBadge />}
</h3>
</div>
</div>
<div className="flex w-full items-center border-t border-[#EAEDF0] px-4 py-2 dark:border-[#2F363D]">
{isMfaEnabled ? <DisableMfaButton /> : <EnableMfaButton />}
</div>
</div>
);
}
export default AccountMfaSettings;

View File

@@ -0,0 +1,69 @@
import { MfaOtpForm } from '@/components/common/MfaOtpForm';
import { Button } from '@/components/ui/v3/button';
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
DialogTrigger,
} from '@/components/ui/v3/dialog';
import useMfaEnabled from '@/features/account/settings/components/AccountMfaSettings/hooks/useMfaEnabled';
import { useNhostClient } from '@/providers/nhost';
import { getToastStyleProps } from '@/utils/constants/settings';
import { useState } from 'react';
import { toast } from 'react-hot-toast';
function DisableMfaButton() {
const nhost = useNhostClient();
const [open, setOpen] = useState(false);
const [isDisabling, setIsDisabling] = useState(false);
const { loading, refetch } = useMfaEnabled();
const buttonDisabled = loading || isDisabling;
async function onSendMfaOtp(code: string) {
try {
setIsDisabling(true);
await nhost.auth.verifyChangeUserMfa({
code,
activeMfaType: '',
});
toast.success(
'Multi-factor authentication has been disabled.',
getToastStyleProps(),
);
await refetch();
setOpen(false);
return true;
} finally {
setIsDisabling(false);
}
}
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>
<Button
variant="outline"
disabled={buttonDisabled}
className="p-y[0.375rem] h-9 gap-2 border-destructive px-2 text-destructive hover:bg-destructive"
>
Disable multi-factor authentication
</Button>
</DialogTrigger>
<DialogContent className="z-[9999] max-w-[28rem] text-foreground">
<DialogHeader>
<DialogTitle>Disable multi-factor authentication</DialogTitle>
</DialogHeader>
<DialogDescription className="hidden">
Disable multi-factor authentication
</DialogDescription>
<MfaOtpForm loading={isDisabling} sendMfaOtp={onSendMfaOtp} />
</DialogContent>
</Dialog>
);
}
export default DisableMfaButton;

View File

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

View File

@@ -0,0 +1,19 @@
import { CopyToClipboardButton } from '@/components/presentational/CopyToClipboardButton';
interface Props {
totpSecret: string | null;
}
function CopyMfaTOTPSecret({ totpSecret }: Props) {
return (
<CopyToClipboardButton
className="p-2"
textToCopy={totpSecret}
title="TOTP secret"
>
OR Copy TOTP secret
</CopyToClipboardButton>
);
}
export default CopyMfaTOTPSecret;

View File

@@ -0,0 +1,48 @@
import { Button } from '@/components/ui/v3/button';
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
DialogTrigger,
} from '@/components/ui/v3/dialog';
import useMfaEnabled from '@/features/account/settings/components/AccountMfaSettings/hooks/useMfaEnabled';
import { useState } from 'react';
import MfaQRCodeAndTOTPSecret from './MfaQRCodeAndTOTPSecret';
function EnableMfaButton() {
const [open, setOpen] = useState(false);
const { isMfaEnabled, loading, refetch } = useMfaEnabled();
const buttonDisabled = loading || isMfaEnabled;
async function handleOnSuccess() {
setOpen(false);
await refetch();
}
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>
<Button
variant="outline"
disabled={buttonDisabled}
className="p-y[0.375rem] h-9 gap-2 border-green-600 px-2 text-green-600 hover:bg-destructive hover:bg-green-600"
>
Enable multi-factor authentication
</Button>
</DialogTrigger>
<DialogContent className="z-[9999] max-w-[28rem] text-foreground">
<DialogHeader>
<DialogTitle>Enable multi-factor authentication</DialogTitle>
</DialogHeader>
<DialogDescription className="hidden">
Enable multi-factor authentication
</DialogDescription>
<MfaQRCodeAndTOTPSecret onSuccess={handleOnSuccess} />
</DialogContent>
</Dialog>
);
}
export default EnableMfaButton;

View File

@@ -0,0 +1,75 @@
/* eslint-disable @next/next/no-img-element */
import { MfaOtpForm } from '@/components/common/MfaOtpForm';
import { Spinner } from '@/components/ui/v3/spinner';
import { useNhostClient } from '@/providers/nhost';
import { getToastStyleProps } from '@/utils/constants/settings';
import { useEffect, useState } from 'react';
import { toast } from 'react-hot-toast';
import CopyMfaTOTPSecret from './CopyMfaTOTPSecret';
interface Props {
onSuccess: () => void;
}
function MfaQRCodeAndTOTPSecret({ onSuccess }: Props) {
const [qrCodeDataUrl, setQrCodeDataUrl] = useState<string | undefined>();
const [totpSecret, setTotpSecret] = useState<string | undefined>();
const [isGenerating, setIsGenerating] = useState(false);
const [isActivating, setIsActivating] = useState(false);
const nhost = useNhostClient();
async function onSendMfaOtp(code: string) {
try {
setIsActivating(true);
await nhost.auth.verifyChangeUserMfa({
code,
activeMfaType: 'totp',
});
toast.success(
'Multi-factor authentication has been enabled.',
getToastStyleProps(),
);
onSuccess();
return true;
} finally {
setIsActivating(false);
}
}
useEffect(() => {
async function generate() {
try {
setIsGenerating(true);
const response = await nhost.auth.changeUserMfa();
setQrCodeDataUrl(response.body.imageUrl);
setTotpSecret(response.body.totpSecret);
} catch (error) {
toast.error(error?.message, getToastStyleProps());
} finally {
setIsGenerating(false);
}
}
generate();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (
<div className="flex w-full flex-col items-center justify-center gap-4">
{isGenerating && <Spinner />}
{qrCodeDataUrl && (
<>
<div className="flex flex-col justify-center gap-4">
<p className="text-base">
Scan the QR Code with your authenticator app
</p>
<img alt="qrcode" src={qrCodeDataUrl} className="mx-auto w-64" />
</div>
<CopyMfaTOTPSecret totpSecret={totpSecret} />
<MfaOtpForm loading={isActivating} sendMfaOtp={onSendMfaOtp} />
</>
)}
</div>
);
}
export default MfaQRCodeAndTOTPSecret;

View File

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

View File

@@ -0,0 +1,17 @@
import { useUserData } from '@/hooks/useUserData';
import { isNotEmptyValue } from '@/lib/utils';
import { useGetActiveMfaTypeQuery } from '@/utils/__generated__/graphql';
function useMfaEnabled() {
const userData = useUserData();
const { data, loading, refetch } = useGetActiveMfaTypeQuery({
variables: { id: userData?.id },
fetchPolicy: 'cache-first',
});
const isMfaEnabled = isNotEmptyValue(data?.user.activeMfaType);
return { loading, isMfaEnabled, refetch };
}
export default useMfaEnabled;

View File

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

View File

@@ -10,17 +10,16 @@ import { CopyIcon } from '@/components/ui/v2/icons/CopyIcon';
import { Input } from '@/components/ui/v2/Input';
import { Option } from '@/components/ui/v2/Option';
import { Text } from '@/components/ui/v2/Text';
import useActionWithElevatedPermissions from '@/features/account/settings/hooks/useActionWithElevatedPermissions';
import { useNhostClient } from '@/providers/nhost';
import type { DialogFormProps } from '@/types/common';
import { GetPersonalAccessTokensDocument } from '@/utils/__generated__/graphql';
import { getToastStyleProps } from '@/utils/constants/settings';
import { copy } from '@/utils/copy';
import { getDateComponents } from '@/utils/getDateComponents';
import { useApolloClient } from '@apollo/client';
import { yupResolver } from '@hookform/resolvers/yup';
import { useNhostClient } from '@nhost/nextjs';
import { useEffect, useState } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
import { toast } from 'react-hot-toast';
import * as Yup from 'yup';
export const createPATFormValidationSchema = Yup.object({
@@ -84,6 +83,25 @@ export default function CreatePATForm({
resolver: yupResolver(createPATFormValidationSchema),
});
const createPAT = useActionWithElevatedPermissions({
actionFn: async (
expiresAt: string,
metadata?: Record<string, string | number>,
) => {
const result = await nhostClient.auth.createPAT({ expiresAt, metadata });
return result;
},
successMessage: 'The personal access token has been created successfully.',
onSuccess: ({ body }) => {
setPersonalAccessToken(body.personalAccessToken);
apolloClient.refetchQueries({
include: [GetPersonalAccessTokensDocument],
});
form.reset();
},
});
const { register, formState } = form;
const isDirty = Object.keys(formState.dirtyFields).length > 0;
@@ -93,44 +111,12 @@ export default function CreatePATForm({
}, [isDirty, location, onDirtyStateChange]);
async function handleSubmit(formValues: CreatePATFormValues) {
try {
const { error, data } = await nhostClient.auth.createPAT(
new Date(formValues.expiresAt),
{
name: formValues.name,
application: 'dashboard',
userAgent: window.navigator.userAgent,
},
);
const toastStyle = getToastStyleProps();
if (error) {
toast.error(error.message, {
style: toastStyle.style,
...toastStyle.error,
});
return;
}
toast.success(
'The personal access token has been created successfully.',
{
style: toastStyle.style,
...toastStyle.success,
},
);
setPersonalAccessToken(data?.personalAccessToken);
apolloClient.refetchQueries({
include: [GetPersonalAccessTokensDocument],
});
form.reset();
} catch {
// Note: This error is handled by the toast.
}
const expiresAt = new Date(formValues.expiresAt).toISOString();
await createPAT(expiresAt, {
name: formValues.name,
application: 'dashboard',
userAgent: window.navigator.userAgent,
});
}
if (personalAccessToken) {

View File

@@ -5,9 +5,9 @@ import { Button } from '@/components/ui/v2/Button';
import { Checkbox } from '@/components/ui/v2/Checkbox';
import { Text } from '@/components/ui/v2/Text';
import { execPromiseWithErrorToast } from '@/features/orgs/utils/execPromiseWithErrorToast';
import { useUserData } from '@/hooks/useUserData';
import { useAuth } from '@/providers/Auth';
import { useDeleteUserAccountMutation } from '@/utils/__generated__/graphql';
import { useSignOut, useUserData } from '@nhost/nextjs';
import { useRouter } from 'next/router';
import { useState } from 'react';
import { twMerge } from 'tailwind-merge';
@@ -82,14 +82,12 @@ function ConfirmDeleteAccountModal({
}
export default function DeleteAccount() {
const router = useRouter();
const { signOut } = useSignOut();
const { signout } = useAuth();
const { openDialog, closeDialog } = useDialog();
const onDelete = async () => {
await signOut();
await router.push('/signin');
await signout();
};
const confirmDeleteAccount = async () => {

View File

@@ -2,9 +2,9 @@ import { Form } from '@/components/form/Form';
import { SettingsContainer } from '@/components/layout/SettingsContainer';
import { Input } from '@/components/ui/v2/Input';
import { execPromiseWithErrorToast } from '@/features/orgs/utils/execPromiseWithErrorToast';
import { useUserData } from '@/hooks/useUserData';
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';
@@ -19,7 +19,9 @@ export type DisplayNameSettingFormValues = Yup.InferType<
>;
export default function DisplayNameSetting() {
const { id: userID, displayName } = useUserData();
const user = useUserData();
const { id: userID, displayName } = user || {};
const [updateUserDisplayName] = useUpdateUserDisplayNameMutation();

View File

@@ -1,9 +1,10 @@
import { Form } from '@/components/form/Form';
import { SettingsContainer } from '@/components/layout/SettingsContainer';
import { Input } from '@/components/ui/v2/Input';
import { execPromiseWithErrorToast } from '@/features/orgs/utils/execPromiseWithErrorToast';
import useActionWithElevatedPermissions from '@/features/account/settings/hooks/useActionWithElevatedPermissions';
import { useUserData } from '@/hooks/useUserData';
import { useNhostClient } from '@/providers/nhost';
import { yupResolver } from '@hookform/resolvers/yup';
import { useNhostClient, useUserData } from '@nhost/nextjs';
import { FormProvider, useForm } from 'react-hook-form';
import * as Yup from 'yup';
@@ -15,36 +16,34 @@ export type EmailSettingFormValues = Yup.InferType<typeof validationSchema>;
export default function EmailSetting() {
const nhost = useNhostClient();
const { email } = useUserData();
const user = useUserData();
const form = useForm<EmailSettingFormValues>({
reValidateMode: 'onSubmit',
defaultValues: { email },
defaultValues: { email: user?.email },
resolver: yupResolver(validationSchema),
});
const { register, formState } = form;
const isDirty = Object.keys(formState.dirtyFields).length > 0;
const changeEmail = useActionWithElevatedPermissions({
actionFn: async (newEmail: string) => {
const result = await nhost.auth.changeUserEmail({
newEmail,
options: {
redirectTo: `${window.location.origin}/account`,
},
});
return result;
},
successMessage:
'Please check your inbox. Follow the link to finalize changing your email.',
onSuccess: () => form.reset(),
});
async function handleSubmit(formValues: EmailSettingFormValues) {
await execPromiseWithErrorToast(
async () => {
await nhost.auth.changeEmail({
newEmail: formValues.email,
options: {
redirectTo: `${window.location.origin}/account`,
},
});
form.reset({ email: formValues.email });
},
{
loadingMessage: 'Updating your email...',
successMessage:
'Please check your inbox. Follow the link to finalize changing your email.',
errorMessage:
'An error occurred while trying to update your email. Please try again.',
},
);
await changeEmail(formValues.email);
}
return (

View File

@@ -1,93 +0,0 @@
import { Form } from '@/components/form/Form';
import { SettingsContainer } from '@/components/layout/SettingsContainer';
import { Input } from '@/components/ui/v2/Input';
import { execPromiseWithErrorToast } from '@/features/orgs/utils/execPromiseWithErrorToast';
import { yupResolver } from '@hookform/resolvers/yup';
import { useChangePassword } from '@nhost/nextjs';
import { FormProvider, useForm } from 'react-hook-form';
import * as Yup from 'yup';
const validationSchema = Yup.object({
newPassword: Yup.string()
.label('New Password')
.nullable()
.required('This field is required.'),
confirmPassword: Yup.string()
.label('Confirm Password')
.nullable()
.required('This field is required.')
.test(
'passwords-match',
'Passwords must match.',
(value, ctx) => ctx.parent.newPassword === value,
),
});
export type PasswordSettingsFormValues = Yup.InferType<typeof validationSchema>;
export default function PasswordSettings() {
const { changePassword } = useChangePassword();
const form = useForm<PasswordSettingsFormValues>({
reValidateMode: 'onSubmit',
resolver: yupResolver(validationSchema),
});
const { register, formState } = form;
const isDirty = Object.keys(formState.dirtyFields).length > 0;
async function handleSubmit(formValues: PasswordSettingsFormValues) {
await execPromiseWithErrorToast(
async () => {
// TODO fix changePassword should throw an error if something happens
await changePassword(formValues.newPassword);
form.reset();
},
{
loadingMessage: 'Changing password...',
successMessage: 'The password has been changed successfully.',
errorMessage:
'An error occurred while trying to update the password. Please try again.',
},
);
}
return (
<FormProvider {...form}>
<Form onSubmit={handleSubmit}>
<SettingsContainer
title="Change Password"
description="Update your account password."
slotProps={{
submitButton: {
disabled: !isDirty,
loading: formState.isSubmitting,
},
}}
className="grid grid-flow-row lg:grid-cols-5"
>
<Input
{...register('newPassword')}
className="col-span-2"
type="password"
id="new-password"
label="New Password"
fullWidth
helperText={formState.errors.newPassword?.message}
error={Boolean(formState.errors.newPassword)}
/>
<Input
{...register('confirmPassword')}
className="col-span-2 row-start-2"
type="password"
id="confirm-password"
label="Confirm Password"
fullWidth
helperText={formState.errors.confirmPassword?.message}
error={Boolean(formState.errors.confirmPassword)}
/>
</SettingsContainer>
</Form>
</FormProvider>
);
}

View File

@@ -0,0 +1,50 @@
import { FormInput } from '@/components/form/FormInput';
import { Button } from '@/components/ui/v3/button';
import { Form } from '@/components/ui/v3/form';
import useChangePasswordForm from '@/features/account/settings/components/PasswordSettings/hooks/useChangePasswordForm';
import useOnChangePasswordHandler from '@/features/account/settings/components/PasswordSettings/hooks/useOnChangePasswordHandler';
export default function PasswordSettings() {
const form = useChangePasswordForm();
const onSubmit = useOnChangePasswordHandler({
onSuccess: () => form.reset(),
});
return (
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)}>
<div className="rounded-lg border border-[#EAEDF0] bg-white font-['Inter_var'] dark:border-[#2F363D] dark:bg-paper">
<div className="flex w-full flex-col items-start gap-4 p-4">
<div className="flex w-full flex-col items-start">
<h3 className="text-[1.125rem] font-semibold leading-[1.75]">
Change Password
</h3>
<p className="text-[#556378] dark:text-[#A2B3BE]">
Update your account password.
</p>
</div>
<div className="flex w-[370px] flex-col gap-4">
<FormInput
control={form.control}
name="newPassword"
type="password"
label="New Password"
/>
<FormInput
control={form.control}
name="confirmPassword"
type="password"
label="Confirm Password"
/>
</div>
</div>
<div className="flex w-full items-center justify-end border-t border-[#EAEDF0] px-4 py-2 dark:border-[#2F363D]">
<Button type="submit" variant="outline">
Save
</Button>
</div>
</div>
</form>
</Form>
);
}

View File

@@ -0,0 +1,39 @@
import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import { z } from 'zod';
const validationSchema = z
.object({
newPassword: z
.string({
required_error: 'This field is required.',
})
.min(1, 'This field is required.'),
confirmPassword: z
.string({
required_error: 'This field is required.',
})
.min(1, 'This field is required.'),
})
.refine((data) => data.newPassword === data.confirmPassword, {
message: 'Passwords must match.',
path: ['confirmPassword'],
});
export type ChangePasswordFormValues = z.infer<typeof validationSchema>;
function useChangePasswordForm() {
const form = useForm<ChangePasswordFormValues>({
mode: 'onTouched',
reValidateMode: 'onBlur',
defaultValues: {
newPassword: '',
confirmPassword: '',
},
resolver: zodResolver(validationSchema),
});
return form;
}
export default useChangePasswordForm;

View File

@@ -0,0 +1,27 @@
import useActionWithElevatedPermissions from '@/features/account/settings/hooks/useActionWithElevatedPermissions';
import { useNhostClient } from '@/providers/nhost';
import { type ChangePasswordFormValues } from './useChangePasswordForm';
interface Props {
onSuccess: () => void;
}
function useOnChangePasswordHandler({ onSuccess }: Props) {
const nhost = useNhostClient();
const changePassword = useActionWithElevatedPermissions({
actionFn: nhost.auth.changeUserPassword,
onSuccess,
successMessage: 'The password has been changed successfully.',
});
async function onSubmit(values: ChangePasswordFormValues) {
const { newPassword } = values;
await changePassword({ newPassword });
}
return onSubmit;
}
export default useOnChangePasswordHandler;

View File

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

View File

@@ -0,0 +1,45 @@
import { Button } from '@/components/ui/v3/button';
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
DialogTrigger,
} from '@/components/ui/v3/dialog';
import { Plus } from 'lucide-react';
import { useState } from 'react';
import SecurityKeyForm from './NewSecurityKeyForm';
function AddSecurityKeyButton() {
const [open, setOpen] = useState(false);
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>
<Button
variant="ghost"
className="h-9 gap-2 px-2 py-[0.375rem] hover:bg-[#d6eefb] dark:hover:bg-[#1e2942]"
>
<Plus className="h-5 w-5" />
Add New Security Key
</Button>
</DialogTrigger>
<DialogContent
className="sr z-[9999] text-foreground sm:max-w-xl"
aria-describedby="Add a Security Key"
>
<DialogHeader>
<DialogTitle>Add a Security Key</DialogTitle>
</DialogHeader>
<DialogDescription className="sr-only">
Add a Security Key
</DialogDescription>
<SecurityKeyForm onSuccess={() => setOpen(false)} />
</DialogContent>
</Dialog>
);
}
export default AddSecurityKeyButton;

View File

@@ -0,0 +1,56 @@
import { Button } from '@/components/ui/v3/button';
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from '@/components/ui/v3/form';
import { Input } from '@/components/ui/v3/input';
import useNewSecurityKeyForm from '@/features/account/settings/components/SecurityKeysSettings/hooks/useNewSecurityKeyForm';
import useOnAddNewSecurityKeyHandler from '@/features/account/settings/components/SecurityKeysSettings/hooks/useOnAddNewSecurityKeyHandler';
interface Props {
onSuccess: () => void;
}
function NewSecurityKeyForm({ onSuccess }: Props) {
const form = useNewSecurityKeyForm();
const onSubmit = useOnAddNewSecurityKeyHandler({ onSuccess });
return (
<Form {...form}>
<form
onSubmit={form.handleSubmit(onSubmit)}
className="grid grid-flow-row gap-4 bg-transparent"
>
<FormField
control={form.control}
name="nickname"
render={({ field }) => (
<FormItem>
<FormLabel>Name</FormLabel>
<FormControl>
<Input
placeholder="Name"
{...field}
className="!bg-transparent"
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<Button
type="submit"
variant="outline"
className="w-full !bg-transparent"
>
Add new security key
</Button>
</form>
</Form>
);
}
export default NewSecurityKeyForm;

View File

@@ -0,0 +1,34 @@
import { Button } from '@/components/ui/v3/button';
import useRemoveSecurityKey from '@/features/account/settings/components/SecurityKeysSettings/hooks/useRemoveSecurityKey';
import { execPromiseWithErrorToast } from '@/features/orgs/utils/execPromiseWithErrorToast';
import { Trash } from 'lucide-react';
import { memo } from 'react';
interface Props {
id: string;
}
function RemoveSecurityKeyButton({ id }: Props) {
const removeSecurityKey = useRemoveSecurityKey();
function handleClick() {
execPromiseWithErrorToast(async () => removeSecurityKey(id), {
loadingMessage: 'Removing security key...',
successMessage: 'Security key has been removed successfully.',
errorMessage:
'An error occurred while trying to remove security key. Please try again.',
});
}
return (
<Button
variant="ghost"
onClick={handleClick}
aria-label={`Remove security key ${id}`}
>
<Trash />
</Button>
);
}
export default memo(RemoveSecurityKeyButton);

View File

@@ -0,0 +1,43 @@
import { Spinner } from '@/components/ui/v3/spinner';
import useGetSecurityKeys from '@/features/account/settings/hooks/useGetSecurityKeys';
import { InfoAlert } from '@/features/orgs/components/InfoAlert';
import { Fingerprint } from 'lucide-react';
import { memo } from 'react';
import RemoveSecurityKeyButton from './RemoveSecurityKeyButton';
type SecurityKeyProps = {
id: string;
nickname?: string;
};
function SecurityKey({ id, nickname }: SecurityKeyProps) {
return (
<div className="flex w-full items-center justify-between rounded-lg border border-[#EAEDF0] px-2 py-2 dark:border-[#2F363D]">
<div className="flex justify-start gap-3">
<Fingerprint />
<span>{nickname || id}</span>
</div>
<RemoveSecurityKeyButton id={id} />
</div>
);
}
const MemoizedSecurityKey = memo(SecurityKey);
function SecurityKeyList() {
const { data, loading } = useGetSecurityKeys();
return (
<div>
{loading && <Spinner />}
{!loading && data?.authUserSecurityKeys.length === 0 && (
<InfoAlert>No security keys have been added yet!</InfoAlert>
)}
{data?.authUserSecurityKeys.map(({ id, nickname }) => (
<MemoizedSecurityKey key={id} id={id} nickname={nickname} />
))}
</div>
);
}
export default SecurityKeyList;

View File

@@ -0,0 +1,24 @@
import AddSecurityKeyButton from './AddSecurityKeyButton';
import SecurityKeyList from './SecurityKeyList';
function SecurityKeysSettings() {
return (
<div className="rounded-lg border border-[#EAEDF0] bg-white font-display dark:border-[#2F363D] dark:bg-paper">
<div className="flex w-full flex-col items-start gap-6 p-4">
<div className="flex w-full items-center justify-between">
<h3 className="text-[1.125rem] font-semibold leading-[1.75]">
Manage your security keys
</h3>
</div>
<div className="flex w-full flex-col gap-4">
<SecurityKeyList />
</div>
</div>
<div className="flex w-full items-center border-t border-[#EAEDF0] px-4 py-2 dark:border-[#2F363D]">
<AddSecurityKeyButton />
</div>
</div>
);
}
export default SecurityKeysSettings;

View File

@@ -0,0 +1,25 @@
import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import { z } from 'zod';
const validationSchema = z
.object({
nickname: z.string().min(1, { message: 'Nickname is required' }),
})
.required();
export type NewSecurityKeyFormValues = z.infer<typeof validationSchema>;
function useNewSecurityKeyForm() {
const form = useForm<NewSecurityKeyFormValues>({
reValidateMode: 'onSubmit',
defaultValues: {
nickname: '',
},
resolver: zodResolver(validationSchema),
});
return form;
}
export default useNewSecurityKeyForm;

View File

@@ -0,0 +1,38 @@
import useActionWithElevatedPermissions from '@/features/account/settings/hooks/useActionWithElevatedPermissions';
import useGetSecurityKeys from '@/features/account/settings/hooks/useGetSecurityKeys';
import { useNhostClient } from '@/providers/nhost';
import { startRegistration } from '@simplewebauthn/browser';
import { type NewSecurityKeyFormValues } from './useNewSecurityKeyForm';
interface Props {
onSuccess: () => void;
}
function useOnAddNewSecurityKeyHandler({ onSuccess }: Props) {
const { refetch } = useGetSecurityKeys();
const nhost = useNhostClient();
async function actionFn(nickname: string) {
const webAuthnOptions = await nhost.auth.addSecurityKey();
const credential = await startRegistration(webAuthnOptions.body);
await nhost.auth.verifyAddSecurityKey({ credential, nickname });
}
const addSecurityKey = useActionWithElevatedPermissions({
actionFn,
onSuccess: async () => {
await refetch();
onSuccess();
},
successMessage: 'Security key has been added.',
});
async function onSubmit(values: NewSecurityKeyFormValues) {
const { nickname } = values;
await addSecurityKey(nickname);
}
return onSubmit;
}
export default useOnAddNewSecurityKeyHandler;

View File

@@ -0,0 +1,22 @@
import useElevatedPermissions from '@/features/account/settings/hooks/useElevatedPermissions';
import useGetSecurityKeys from '@/features/account/settings/hooks/useGetSecurityKeys';
import { useRemoveSecurityKeyMutation } from '@/utils/__generated__/graphql';
function useRemoveSecurityKey() {
const [removeSecurityKeyMutation] = useRemoveSecurityKeyMutation();
const elevatePermissions = useElevatedPermissions();
const { refetch: refetchSecurityKeys } = useGetSecurityKeys();
async function removeSecurityKey(id: string) {
const permissionGranted = await elevatePermissions(true);
if (permissionGranted) {
await removeSecurityKeyMutation({ variables: { id } });
await refetchSecurityKeys();
}
}
return removeSecurityKey;
}
export default useRemoveSecurityKey;

View File

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

View File

@@ -4,20 +4,29 @@ 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 { useAccessToken } from '@/hooks/useAccessToken';
import { useNhostClient } from '@/providers/nhost';
import { useGetAuthUserProvidersQuery } from '@/utils/__generated__/graphql';
import { useProviderLink } from '@nhost/nextjs';
import NavLink from 'next/link';
import { useMemo } from 'react';
export default function SocialProvidersSettings() {
const nhost = useNhostClient();
const token = useAccessToken();
const { data, loading, error } = useGetAuthUserProvidersQuery();
const isGithubConnected = data?.authUserProviders?.some(
(item) => item.providerId === 'github',
);
const { github } = useProviderLink({
connect: true,
redirectTo: `${window.location.origin}/account`,
});
const github = useMemo(
() =>
nhost.auth.signInProviderURL('github', {
connect: token,
redirectTo: `${window.location.origin}/account`,
}),
// eslint-disable-next-line react-hooks/exhaustive-deps
[token],
);
if (!data && loading) {
return (

View File

@@ -0,0 +1,5 @@
query getActiveMfaType($id: uuid!) {
user(id: $id) {
activeMfaType
}
}

View File

@@ -0,0 +1,6 @@
query securityKeys($userId: uuid!) {
authUserSecurityKeys(where: { userId: { _eq: $userId } }) {
id
nickname
}
}

View File

@@ -0,0 +1,5 @@
mutation removeSecurityKey($id: uuid!) {
deleteAuthUserSecurityKey(id: $id) {
id
}
}

View File

@@ -0,0 +1,54 @@
import useElevatedPermissions from '@/features/account/settings/hooks/useElevatedPermissions';
import useGetSecurityKeys from '@/features/account/settings/hooks/useGetSecurityKeys';
import { toast } from 'react-hot-toast';
type Action = (...args: any[]) => Promise<any>;
type UnwrapPromise<T> = T extends Promise<infer U> ? U : T;
interface Props<Fn extends Action> {
actionFn: Fn;
onSuccess?: (result: UnwrapPromise<ReturnType<Fn>>) => void;
onError?: () => void;
successMessage?: string;
}
function useActionWithElevatedPermissions<F extends Action>({
actionFn,
onSuccess,
onError,
successMessage,
}: Props<F>) {
const elevatePermissions = useElevatedPermissions();
const { data } = useGetSecurityKeys();
async function requestPermissions() {
if (data?.authUserSecurityKeys.length === 0) {
return true;
}
const isPermissionsElevated = await elevatePermissions();
return isPermissionsElevated;
}
async function actionWithElevatedPermissions(...args: Parameters<F>) {
let isSuccess = false;
const permissionGranted = await requestPermissions();
if (!permissionGranted) {
return isSuccess;
}
try {
const response = await actionFn(...args);
toast.success(successMessage || 'Success.');
onSuccess?.(response as UnwrapPromise<ReturnType<F>>);
isSuccess = true;
} catch (error) {
toast.error(error?.message || 'Something went wrong.');
onError?.();
}
return isSuccess;
}
return actionWithElevatedPermissions;
}
export default useActionWithElevatedPermissions;

View File

@@ -0,0 +1,37 @@
import { useElevateEmail } from '@/hooks/useElevateEmail';
import { useHasuraClaims } from '@/hooks/useHasuraClaims';
import { useUserData } from '@/hooks/useUserData';
import { getToastStyleProps } from '@/utils/constants/settings';
import { toast } from 'react-hot-toast';
function useElevatedPermissions() {
const user = useUserData();
const elevateEmail = useElevateEmail();
const claims = useHasuraClaims();
async function elevatePermissions(shouldThrowError = false) {
const elevated = user
? claims?.['x-hasura-auth-elevated'] === user?.id
: false;
if (elevated) {
return true;
}
try {
await elevateEmail();
return true;
} catch (e) {
if (shouldThrowError) {
throw e;
} else {
const message = e?.message || 'Could not elevate permissions';
toast.error(message, getToastStyleProps());
return false;
}
}
}
return elevatePermissions;
}
export default useElevatedPermissions;

View File

@@ -0,0 +1,15 @@
import { useUserData } from '@/hooks/useUserData';
import { useSecurityKeysQuery } from '@/utils/__generated__/graphql';
function useGetSecurityKeys() {
const user = useUserData();
const query = useSecurityKeysQuery({
variables: {
userId: user?.id,
},
});
return query;
}
export default useGetSecurityKeys;

View File

@@ -0,0 +1,35 @@
import { ButtonWithLoading as Button } from '@/components/ui/v3/button';
import {
useGithubAuthentication,
type UseGithubAuthenticationHookProps,
} from '@/features/auth/AuthProviders/Github/hooks/useGithubAuthentication';
import { SiGithub } from '@icons-pack/react-simple-icons';
interface Props extends UseGithubAuthenticationHookProps {
buttonText?: string;
withAnonId?: boolean;
redirectTo?: string;
}
function GithubAuthButton({
buttonText = 'Continue with GitHub',
withAnonId = false,
redirectTo,
}: Props) {
const { mutate: signInWithGithub, isLoading } = useGithubAuthentication({
withAnonId,
redirectTo,
});
return (
<Button
className="gap-2 !bg-white text-sm+ !text-black hover:ring-2 hover:ring-white hover:ring-opacity-50 disabled:!text-black disabled:!text-opacity-60"
disabled={isLoading}
loading={isLoading}
onClick={() => signInWithGithub()}
>
<SiGithub size={14} /> {buttonText}
</Button>
);
}
export default GithubAuthButton;

View File

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

View File

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

View File

@@ -0,0 +1,47 @@
import { getAnonId } from '@/lib/segment';
import { isNotEmptyValue } from '@/lib/utils';
import { getToastStyleProps } from '@/utils/constants/settings';
import { nhost } from '@/utils/nhost';
import type { SignInProviderParams } from '@nhost/nhost-js-beta/auth';
import { useMutation } from '@tanstack/react-query';
import { toast } from 'react-hot-toast';
export interface UseGithubAuthenticationHookProps {
withAnonId?: boolean;
redirectTo?: string;
errorText?: string;
}
function useGithubAuthentication({
withAnonId = false,
redirectTo,
errorText,
}: UseGithubAuthenticationHookProps) {
const githubAuthenticationMutation = useMutation(
async () => {
let options: SignInProviderParams | undefined;
if (isNotEmptyValue(redirectTo)) {
options = {
redirectTo,
};
}
if (withAnonId) {
options = {
metadata: { anonId: await getAnonId() },
...options,
};
}
const redirectURl = nhost.auth.signInProviderURL('github', options);
window.location.href = redirectURl;
},
{
onError: () => {
toast.error(errorText, getToastStyleProps());
},
},
);
return githubAuthenticationMutation;
}
export default useGithubAuthentication;

View File

@@ -0,0 +1,31 @@
import { Button } from '@/components/ui/v3/button';
import { useSignInWithSecurityKey } from '@/features/auth/SignIn/SecurityKey/hooks/useSignInWithSecurityKey';
import { Fingerprint } from 'lucide-react';
import { useState } from 'react';
import { VerifyEmailDialog } from './VerifyEmailDialog';
function SignInWithSecurityKey() {
const [open, setOpen] = useState(false);
function onNeedsEmailVerification() {
setOpen(true);
}
const { disabled, signInWithSecurityKey } = useSignInWithSecurityKey({
onNeedsEmailVerification,
});
return (
<>
<VerifyEmailDialog open={open} setOpen={setOpen} />
<Button
variant="ghost"
className="gap-2 !bg-white text-sm+ !text-black hover:ring-2 hover:ring-white hover:ring-opacity-50 disabled:!text-black disabled:!text-opacity-60"
disabled={disabled}
onClick={signInWithSecurityKey}
>
<Fingerprint size={14} />
Continue with a security key
</Button>
</>
);
}
export default SignInWithSecurityKey;

View File

@@ -0,0 +1,28 @@
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
} from '@/components/ui/v3/dialog';
interface Props {
open: boolean;
setOpen: (openState: boolean) => void;
}
export function VerifyEmailDialog({ open, setOpen }: Props) {
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogContent className="text-foreground sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Email verification required</DialogTitle>
<DialogDescription>
You need to verify your email first. Please check your mailbox and
follow the confirmation link to complete the registration.
</DialogDescription>
</DialogHeader>
</DialogContent>
</Dialog>
);
}

View File

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

View File

@@ -0,0 +1,47 @@
import { isNotEmptyValue } from '@/lib/utils';
import { useNhostClient } from '@/providers/nhost';
import { getToastStyleProps } from '@/utils/constants/settings';
import { startAuthentication } from '@simplewebauthn/browser';
import { useState } from 'react';
import { toast } from 'react-hot-toast';
interface Props {
onNeedsEmailVerification: () => void;
}
function useSignInWithSecurityKey({ onNeedsEmailVerification }: Props) {
const nhost = useNhostClient();
const [disabled, setDisabled] = useState(false);
async function signInWithSecurityKey() {
try {
setDisabled(true);
const signInWebauthnResponse = await nhost.auth.signInWebauthn();
const { body: options } = signInWebauthnResponse;
const credential = await startAuthentication(options);
await nhost.auth.verifySignInWebauthn({
credential,
});
} catch (error) {
let errorMessage =
error?.message ||
'An error occurred while signing in. Please try again.';
if (isNotEmptyValue(error?.body)) {
const errorCode = error.body.error;
if (errorCode === 'unverified-user') {
onNeedsEmailVerification();
return;
}
errorMessage = error.body.message;
}
toast.error(errorMessage, getToastStyleProps());
} finally {
setDisabled(false);
}
}
return { disabled, signInWithSecurityKey };
}
export default useSignInWithSecurityKey;

View File

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

View File

@@ -0,0 +1,30 @@
import { MfaOtpForm } from '@/components/common/MfaOtpForm';
import { Smartphone } from 'lucide-react';
interface Props {
sendMfaOtp: (code: string) => Promise<any>;
loading: boolean;
requestNewMfaTicket: () => Promise<void>;
}
function MfaSignInOtpForm({ sendMfaOtp, loading, requestNewMfaTicket }: Props) {
return (
<div className="ws-full relative grid grid-flow-row gap-4 bg-transparent">
<div className="flex w-full flex-col items-center justify-center gap-3">
<Smartphone size={32} />
<h2 className="text-[1.25rem]">Authentication Code</h2>
</div>
<MfaOtpForm
loading={loading}
sendMfaOtp={sendMfaOtp}
requestNewMfaTicket={requestNewMfaTicket}
/>
<p className="text-center">
Open your authenticator app or browser extension to view your
authentication code.
</p>
</div>
);
}
export default MfaSignInOtpForm;

View File

@@ -0,0 +1,54 @@
import useOnSignInWithEmailAndPasswordHandler from '@/features/auth/SignIn/SignInWithEmailAndPassword/hooks/useOnSignInWithEmailAndPasswordHandler';
import useRequestNewMfaTicket from '@/features/auth/SignIn/SignInWithEmailAndPassword/hooks/useRequestNewMfaTicket';
import { useNhostClient } from '@/providers/nhost';
import { useRef, useState } from 'react';
import MfaSignInOtpForm from './MfaSignInOtpForm';
import SignInWithEmailAndPasswordForm from './SignInWithEmailAndPasswordForm';
function SignInWithEmailAndPassword() {
const [needsMfaOtp, setNeedsMfaOtp] = useState(false);
const mfaTicket = useRef<string | undefined>();
const [isMfaLoading, setIsMfaLoading] = useState(false);
const nhost = useNhostClient();
function onNeedsMfa(ticket: string) {
mfaTicket.current = ticket;
setNeedsMfaOtp(true);
}
const { onSignInWithEmailAndPassword, isLoading, emailAndPasswordRef } =
useOnSignInWithEmailAndPasswordHandler({ onNeedsMfa });
const requestNewMfaTicketFn = useRequestNewMfaTicket();
async function requestNewMfaTicket() {
const { email, password } = emailAndPasswordRef.current;
mfaTicket.current = await requestNewMfaTicketFn(email, password);
}
async function onHandleSendMfaOtp(otp: string) {
try {
setIsMfaLoading(true);
await nhost.auth.verifySignInMfaTotp({
ticket: mfaTicket.current,
otp,
});
} finally {
setIsMfaLoading(false);
}
}
return needsMfaOtp ? (
<MfaSignInOtpForm
sendMfaOtp={onHandleSendMfaOtp}
loading={isMfaLoading}
requestNewMfaTicket={requestNewMfaTicket}
/>
) : (
<SignInWithEmailAndPasswordForm
onSubmit={onSignInWithEmailAndPassword}
isLoading={isLoading}
/>
);
}
export default SignInWithEmailAndPassword;

View File

@@ -0,0 +1,60 @@
import { FormInput } from '@/components/form/FormInput';
import { ButtonWithLoading as Button } from '@/components/ui/v3/button';
import { Form } from '@/components/ui/v3/form';
import useSignInWithEmailAndPasswordForm, {
type SignInWithEmailAndPasswordFormValues,
} from '@/features/auth/SignIn/SignInWithEmailAndPassword/hooks/useSignInWithEmailAndPasswordForm';
import NextLink from 'next/link';
interface Props {
onSubmit: (values: SignInWithEmailAndPasswordFormValues) => void;
isLoading: boolean;
}
function SignInWithEmailAndPassword({ onSubmit, isLoading }: Props) {
const form = useSignInWithEmailAndPasswordForm();
return (
<Form {...form}>
<form
onSubmit={form.handleSubmit(onSubmit)}
className="grid grid-flow-row gap-4 bg-transparent"
>
<FormInput
control={form.control}
label="Email"
name="email"
type="email"
/>
<FormInput
control={form.control}
label="Password"
name="password"
type="password"
/>
<NextLink
href="/password/new"
className="justify-self-start font-semibold"
>
Forgot password?
</NextLink>
<Button
type="submit"
variant="outline"
className="w-full !bg-white !text-black disabled:!text-black disabled:!text-opacity-60"
disabled={isLoading}
loading={isLoading}
>
Sign In
</Button>
<p color="secondary" className="text-center">
<span className="text-[#A2B3BE]">or </span>
<NextLink className="font-semibold" href="/signin">
sign in with GitHub
</NextLink>
</p>
</form>
</Form>
);
}
export default SignInWithEmailAndPassword;

View File

@@ -0,0 +1,65 @@
import { isNotEmptyValue } from '@/lib/utils';
import { useNhostClient } from '@/providers/nhost';
import { getToastStyleProps } from '@/utils/constants/settings';
import { useRouter } from 'next/router';
import { useRef, useState } from 'react';
import toast from 'react-hot-toast';
import type { SignInWithEmailAndPasswordFormValues } from './useSignInWithEmailAndPasswordForm';
interface Props {
onNeedsMfa: (mfaTicket: string) => void;
}
type EmailAndPasswordRef = {
email: string;
password: string;
} | null;
function useOnSignInWithEmailAndPasswordHandler({ onNeedsMfa }: Props) {
const [isLoading, setIsloading] = useState(false);
const nhost = useNhostClient();
const router = useRouter();
const emailAndPasswordRef = useRef<EmailAndPasswordRef>();
async function onSignInWithEmailAndPassword({
email,
password,
}: SignInWithEmailAndPasswordFormValues) {
try {
setIsloading(true);
const response = await nhost.auth.signInEmailPassword({
email,
password,
});
emailAndPasswordRef.current = {
email,
password,
};
if (response.body.mfa) {
onNeedsMfa(response.body.mfa.ticket);
}
} catch (error) {
let errorMessage =
error?.message ||
'An error occurred while signing in. Please try again.';
if (isNotEmptyValue(error?.body)) {
const errorCode = error.body.error;
if (errorCode === 'unverified-user') {
await nhost.auth.sendVerificationEmail({ email });
router.push(`/email/verify?email=${encodeURIComponent(email)}`);
return;
}
errorMessage = error.body.message;
}
toast.error(errorMessage, getToastStyleProps());
} finally {
setIsloading(false);
}
}
return { onSignInWithEmailAndPassword, isLoading, emailAndPasswordRef };
}
export default useOnSignInWithEmailAndPasswordHandler;

View File

@@ -0,0 +1,29 @@
import { useNhostClient } from '@/providers/nhost';
import { getToastStyleProps } from '@/utils/constants/settings';
import toast from 'react-hot-toast';
function useRequestNewMfaTicket() {
const nhost = useNhostClient();
async function requestNewMfaTicket(email: string, password: string) {
let mfaTicket: string;
try {
const response = await nhost.auth.signInEmailPassword({
email,
password,
});
mfaTicket = response.body?.mfa.ticket;
} catch (error) {
toast.error(
error?.message ||
'An error occurred while verifying TOTP. Please try again.',
getToastStyleProps(),
);
}
return mfaTicket;
}
return requestNewMfaTicket;
}
export default useRequestNewMfaTicket;

View File

@@ -0,0 +1,30 @@
import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import { z } from 'zod';
const validationSchema = z
.object({
email: z.string().email({ message: 'Invalid email address' }),
password: z.string().min(1, { message: 'Password is required' }),
})
.required();
export type SignInWithEmailAndPasswordFormValues = z.infer<
typeof validationSchema
>;
function useSignInWithEmailAndPasswordForm() {
const form = useForm<SignInWithEmailAndPasswordFormValues>({
mode: 'onTouched',
reValidateMode: 'onBlur',
defaultValues: {
email: '',
password: '',
},
resolver: zodResolver(validationSchema),
});
return form;
}
export default useSignInWithEmailAndPasswordForm;

View File

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

View File

@@ -0,0 +1,15 @@
import { GithubAuthButton } from '@/features/auth/AuthProviders/Github/components/GithubAuthButton';
import { useHostName } from '@/features/orgs/projects/common/hooks/useHostName';
function SignInWithGithub() {
const redirectTo = useHostName();
return (
<GithubAuthButton
redirectTo={redirectTo}
buttonText="Continue with GitHub"
errorText="An error occurred while trying to sign in using GitHub. Please try again later."
/>
);
}
export default SignInWithGithub;

View File

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

View File

@@ -0,0 +1,39 @@
import {
Tabs,
TabsContent,
TabsList,
TabsTrigger,
} from '@/components/ui/v3/tabs';
import { useState } from 'react';
import { SignUpWithEmailAndPasswordForm } from './SignUpWithEmailAndPassword';
import { SignUpWithSecurityKeyForm } from './SignUpWithSecurityKey';
function SignUpTabs() {
const [tab, setTab] = useState<string>('password');
return (
<Tabs value={tab} onValueChange={setTab} className="w-full">
<TabsList className="w-full">
<TabsTrigger value="password" className="w-full">
Sign Up with a Password
</TabsTrigger>
<TabsTrigger value="security-key" className="w-full">
Sign Up with a Security key
</TabsTrigger>
</TabsList>
<div className="pt-7">
{tab === 'password' && (
<TabsContent value="password">
<SignUpWithEmailAndPasswordForm />
</TabsContent>
)}
{tab === 'security-key' && (
<TabsContent value="security-key">
<SignUpWithSecurityKeyForm />
</TabsContent>
)}
</div>
</Tabs>
);
}
export default SignUpTabs;

View File

@@ -0,0 +1,81 @@
import { FormInput } from '@/components/form/FormInput';
import { Button } from '@/components/ui/v3/button';
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from '@/components/ui/v3/form';
import useOnSignUpWithPasswordHandler from '@/features/auth/SignUp/SignUpTabs/SignUpWithEmailAndPassword/hooks/useOnSignUpWithPasswordHandler';
import useSignUpWithEmailAndPasswordForm from '@/features/auth/SignUp/SignUpTabs/SignUpWithEmailAndPassword/hooks/useSignUpWithEmailAndPasswordForm';
import { Turnstile } from '@marsidev/react-turnstile';
function SignUpWithEmailAndPasswordForm() {
const form = useSignUpWithEmailAndPasswordForm();
const onSignUpWithPassword = useOnSignUpWithPasswordHandler();
return (
<Form {...form}>
<form
onSubmit={form.handleSubmit(onSignUpWithPassword)}
className="grid grid-flow-row gap-4 bg-transparent"
>
<FormInput control={form.control} label="Name" name="displayName" />
<FormInput
control={form.control}
label="Email"
name="email"
type="email"
/>
<FormInput
control={form.control}
label="Password"
name="password"
type="password"
/>
<FormField
control={form.control}
name="turnstileToken"
render={() => (
<FormItem>
<FormLabel>Verification</FormLabel>
<FormControl>
<Turnstile
siteKey={process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY}
options={{ theme: 'dark', size: 'flexible' }}
onSuccess={(token) => {
form.setValue('turnstileToken', token, {
shouldValidate: true,
});
}}
onError={() => {
form.setValue('turnstileToken', '', {
shouldValidate: true,
});
}}
onExpire={() => {
form.setValue('turnstileToken', '', {
shouldValidate: true,
});
}}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<Button
type="submit"
variant="outline"
className="w-full !bg-transparent"
>
Sign Up
</Button>
</form>
</Form>
);
}
export default SignUpWithEmailAndPasswordForm;

View File

@@ -0,0 +1,51 @@
import { getAnonId } from '@/lib/segment';
import { isEmptyValue } from '@/lib/utils';
import { useNhostClient } from '@/providers/nhost';
import { getToastStyleProps } from '@/utils/constants/settings';
import { useRouter } from 'next/router';
import toast from 'react-hot-toast';
import type { SignUpWithEmailAndPasswordFormValues } from './useSignUpWithEmailAndPasswordForm';
function useOnSignUpWithPasswordHandler() {
const nhost = useNhostClient();
const router = useRouter();
async function onSignUpWithPassword({
email,
password,
displayName,
turnstileToken,
}: SignUpWithEmailAndPasswordFormValues) {
try {
const response = await nhost.auth.signUpEmailPassword(
{
email,
password,
options: {
displayName,
metadata: { anonId: await getAnonId() },
},
},
{
headers: {
'x-cf-turnstile-response': turnstileToken,
},
},
);
if (response.status === 200 && isEmptyValue(response.body)) {
router.push(`/email/verify?email=${encodeURIComponent(email)}`);
}
} catch (error) {
toast.error(
error.message ||
'An error occurred while signing up. Please try again.',
getToastStyleProps(),
);
}
}
return onSignUpWithPassword;
}
export default useOnSignUpWithPasswordHandler;

View File

@@ -0,0 +1,43 @@
import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import { z } from 'zod';
const validationSchema = z
.object({
email: z.string().email({ message: 'Invalid email address' }),
password: z.string().min(1, { message: 'Password is required' }),
displayName: z
.string()
.regex(
/^[\p{L}\p{N}\p{S} ,.'-]+$/u,
'Use only letters, numbers, symbols and basic punctuation',
)
.min(1, { message: 'Name is required' })
.max(32, { message: 'Name must be 32 characters or less' }),
turnstileToken: z
.string()
.min(1, { message: 'Please complete the CAPTCHA' }),
})
.required();
export type SignUpWithEmailAndPasswordFormValues = z.infer<
typeof validationSchema
>;
function useSignUpWithEmailAndPasswordForm() {
const form = useForm<SignUpWithEmailAndPasswordFormValues>({
mode: 'onTouched',
reValidateMode: 'onBlur',
defaultValues: {
email: '',
password: '',
displayName: '',
turnstileToken: '',
},
resolver: zodResolver(validationSchema),
});
return form;
}
export default useSignUpWithEmailAndPasswordForm;

View File

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

View File

@@ -0,0 +1,75 @@
import { FormInput } from '@/components/form/FormInput';
import { Button } from '@/components/ui/v3/button';
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from '@/components/ui/v3/form';
import useSignupWithSecurityKeyForm from '@/features/auth/SignUp/SignUpTabs/SignUpWithSecurityKey/hooks/useSignupWithSecurityKeyForm';
import useSignupWithSecurityKeyHandler from '@/features/auth/SignUp/SignUpTabs/SignUpWithSecurityKey/hooks/useSignupWithSecurityKeyHandler';
import { Turnstile } from '@marsidev/react-turnstile';
function SignUpWithSecurityKeyForm() {
const form = useSignupWithSecurityKeyForm();
const onSignUpWithSecurityKey = useSignupWithSecurityKeyHandler();
return (
<Form {...form}>
<form
onSubmit={form.handleSubmit(onSignUpWithSecurityKey)}
className="grid grid-flow-row gap-4 bg-transparent"
>
<FormInput control={form.control} label="Name" name="displayName" />
<FormInput
control={form.control}
label="Email"
name="email"
type="email"
/>
<FormField
control={form.control}
name="turnstileToken"
render={() => (
<FormItem>
<FormLabel>Verification</FormLabel>
<FormControl>
<Turnstile
siteKey={process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY}
options={{ theme: 'dark', size: 'flexible' }}
onSuccess={(token) => {
form.setValue('turnstileToken', token, {
shouldValidate: true,
});
}}
onError={() => {
form.setValue('turnstileToken', '', {
shouldValidate: true,
});
}}
onExpire={() => {
form.setValue('turnstileToken', '', {
shouldValidate: true,
});
}}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<Button
type="submit"
variant="outline"
className="w-full !bg-transparent"
>
Sign Up
</Button>
</form>
</Form>
);
}
export default SignUpWithSecurityKeyForm;

View File

@@ -0,0 +1,42 @@
import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import { z } from 'zod';
const validationSchema = z
.object({
email: z
.string()
.email({ message: 'Invalid email address' })
.min(1, { message: 'Email is required' }),
displayName: z
.string()
.regex(
/^[\p{L}\p{N}\p{S} ,.'-]+$/u,
'Use only letters, numbers, symbols and basic punctuation',
)
.min(1, { message: 'Name is required' })
.max(32, { message: 'Name must be 32 characters or less' }),
turnstileToken: z
.string()
.min(1, { message: 'Please complete the CAPTCHA' }),
})
.required();
export type SignUpWithSecurityKeyFormValues = z.infer<typeof validationSchema>;
function useSignUpWithSecurityKey() {
const form = useForm<SignUpWithSecurityKeyFormValues>({
mode: 'onTouched',
reValidateMode: 'onBlur',
defaultValues: {
email: '',
displayName: '',
turnstileToken: '',
},
resolver: zodResolver(validationSchema),
});
return form;
}
export default useSignUpWithSecurityKey;

View File

@@ -0,0 +1,61 @@
import { getAnonId } from '@/lib/segment';
import { isEmptyValue } from '@/lib/utils';
import { useNhostClient } from '@/providers/nhost';
import { getToastStyleProps } from '@/utils/constants/settings';
import { startRegistration } from '@simplewebauthn/browser';
import { useRouter } from 'next/router';
import toast from 'react-hot-toast';
import type { SignUpWithSecurityKeyFormValues } from './useSignupWithSecurityKeyForm';
function useOnSignUpWithSecurityKeyHandler() {
const router = useRouter();
const nhost = useNhostClient();
async function onSignUpWithSecurityKey({
email,
displayName,
turnstileToken,
}: SignUpWithSecurityKeyFormValues) {
const metadata = { anonId: await getAnonId() };
try {
const webAuthnResponse = await nhost.auth.signUpWebauthn(
{
email,
options: {
displayName,
metadata,
},
},
{
headers: {
'x-cf-turnstile-response': turnstileToken,
},
},
);
const { body: webAuthnOptions } = webAuthnResponse;
const credential = await startRegistration(webAuthnOptions);
const verifyResponse = await nhost.auth.verifySignUpWebauthn({
credential,
options: {
displayName,
metadata,
},
});
if (verifyResponse.status === 200 && isEmptyValue(verifyResponse.body)) {
router.push(`/email/verify?email=${encodeURIComponent(email)}`);
}
} catch (error) {
toast.error(
error.message ||
'An error occurred while signing up. Please try again.',
getToastStyleProps(),
);
}
}
return onSignUpWithSecurityKey;
}
export default useOnSignUpWithSecurityKeyHandler;

View File

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

View File

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

View File

@@ -0,0 +1,13 @@
import { GithubAuthButton } from '@/features/auth/AuthProviders/Github/components/GithubAuthButton';
function SignUpWithGithub() {
return (
<GithubAuthButton
withAnonId
buttonText="Sign Up with GitHub"
errorText="An error occurred while trying to sign up using GitHub. Please try again."
/>
);
}
export default SignUpWithGithub;

View File

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

View File

@@ -27,6 +27,7 @@ import { StripeEmbeddedForm } from '@/features/orgs/components/StripeEmbeddedFor
import { useIsPlatform } from '@/features/orgs/projects/common/hooks/useIsPlatform';
import { planDescriptions } from '@/features/orgs/projects/common/utils/planDescriptions';
import { execPromiseWithErrorToast } from '@/features/orgs/utils/execPromiseWithErrorToast';
import { useUserData } from '@/hooks/useUserData';
import { cn } from '@/lib/utils';
import {
useCreateOrganizationRequestMutation,
@@ -34,7 +35,6 @@ import {
type PrefetchNewAppPlansFragment,
} from '@/utils/__generated__/graphql';
import { zodResolver } from '@hookform/resolvers/zod';
import { useUserData } from '@nhost/nextjs';
import { DialogDescription } from '@radix-ui/react-dialog';
import { Plus } from 'lucide-react';
import { useState } from 'react';
@@ -197,7 +197,7 @@ export default function CreateOrgDialog({
const isPlatform = useIsPlatform();
const [open, setOpen] = useState(false);
const { data, loading, error } = usePrefetchNewAppQuery({
skip: !user,
skip: !user || !isPlatform,
});
const [createOrganizationRequest] = useCreateOrganizationRequestMutation();
const [stripeClientSecret, setStripeClientSecret] = useState('');

View File

@@ -18,13 +18,13 @@ import {
import { useOrgs, type Org } from '@/features/orgs/projects/hooks/useOrgs';
import { useProject } from '@/features/orgs/projects/hooks/useProject';
import { execPromiseWithErrorToast } from '@/features/orgs/utils/execPromiseWithErrorToast';
import { useUserData } from '@/hooks/useUserData';
import { cn, isNotEmptyValue } from '@/lib/utils';
import {
Organization_Members_Role_Enum,
useBillingTransferAppMutation,
} from '@/utils/__generated__/graphql';
import { zodResolver } from '@hookform/resolvers/zod';
import { useUserId } from '@nhost/nextjs';
import { Plus } from 'lucide-react';
import { useRouter } from 'next/router';
import { useEffect } from 'react';
@@ -53,7 +53,7 @@ function TransferProjectForm({
const { push } = useRouter();
const { orgs, currentOrg } = useOrgs();
const { project } = useProject();
const currentUserId = useUserId();
const user = useUserData();
const [transferProject] = useBillingTransferAppMutation();
const form = useForm<z.infer<typeof transferProjectFormSchema>>({
@@ -133,7 +133,7 @@ function TransferProjectForm({
disabled={
org.plan.isFree || // disable the personal org
org.id === currentOrg.id || // disable the current org as it can't be a destination org
!isUserAdminOfOrg(org, currentUserId) // disable orgs that the current user is not admin of
!isUserAdminOfOrg(org, user?.id) // disable orgs that the current user is not admin of
}
>
{org.name}

View File

@@ -1,13 +1,14 @@
import { Button } from '@/components/ui/v3/button';
import { useCurrentOrg } from '@/features/orgs/projects/hooks/useCurrentOrg';
import { execPromiseWithErrorToast } from '@/features/orgs/utils/execPromiseWithErrorToast';
import { useNhostClient } from '@/providers/nhost';
import { Organization_Status_Enum } from '@/utils/__generated__/graphql';
import nhost from '@/utils/nhost/nhost';
import { Download } from 'lucide-react';
import { useState } from 'react';
export default function Soc2Download() {
const { org } = useCurrentOrg();
const nhost = useNhostClient();
const [downloading, setDownloading] = useState(false);
const showSoc2Download =
@@ -28,26 +29,18 @@ export default function Soc2Download() {
if (!fileId) {
throw new Error('SOC2 report file ID not configured');
}
try {
const response = await nhost.storage.getFile(fileId);
const url = URL.createObjectURL(response.body);
const link = document.createElement('a');
link.href = url;
link.download = 'Nhost-SOC2-Report.pdf';
link.click();
const { file, error } = await nhost.storage.download({
fileId,
});
if (error) {
URL.revokeObjectURL(url);
} catch (error) {
throw new Error(error.message || 'Failed to download SOC2 report');
}
if (!file) {
throw new Error('No file data available');
}
const url = URL.createObjectURL(file);
const link = document.createElement('a');
link.href = url;
link.download = 'Nhost-SOC2-Report.pdf';
link.click();
URL.revokeObjectURL(url);
},
{
loadingMessage: 'Downloading SOC2 report...',

View File

@@ -14,18 +14,18 @@ import {
SheetTitle,
SheetTrigger,
} from '@/components/ui/v3/sheet';
import { useAuth } from '@/providers/Auth';
import {
useDeleteAnnouncementReadMutation,
useGetAnnouncementsQuery,
useInsertAnnouncementReadMutation,
} from '@/utils/__generated__/graphql';
import { useAuthenticationStatus } from '@nhost/nextjs';
import { formatDistance } from 'date-fns';
import { EllipsisVertical, Megaphone } from 'lucide-react';
import Link from 'next/link';
export default function AnnouncementsTray() {
const { isAuthenticated } = useAuthenticationStatus();
const { isAuthenticated } = useAuth();
const {
data,

View File

@@ -16,8 +16,10 @@ import {
SheetTrigger,
} from '@/components/ui/v3/sheet';
import { StripeEmbeddedForm } from '@/features/orgs/components/StripeEmbeddedForm';
import { useIsPlatform } from '@/features/orgs/projects/common/hooks/useIsPlatform';
import { useOrgs } from '@/features/orgs/projects/hooks/useOrgs';
import { execPromiseWithErrorToast } from '@/features/orgs/utils/execPromiseWithErrorToast';
import { useUserData } from '@/hooks/useUserData';
import { isEmptyValue } from '@/lib/utils';
import {
CheckoutStatus,
@@ -29,7 +31,6 @@ import {
type OrganizationMemberInvitesQuery,
type PostOrganizationRequestResponse,
} from '@/utils/__generated__/graphql';
import { useUserData } from '@nhost/nextjs';
import { formatDistance } from 'date-fns';
import { Bell } from 'lucide-react';
import { useRouter } from 'next/router';
@@ -43,6 +44,7 @@ export default function NotificationsTray() {
const { session_id } = query;
const { refetch: refetchOrgs } = useOrgs();
const [open, setOpen] = useState(false);
const isPlatForm = useIsPlatform();
const [stripeFormDialogOpen, setStripeFormDialogOpen] = useState(false);
@@ -61,21 +63,21 @@ export default function NotificationsTray() {
const [postOrganizationRequest] = usePostOrganizationRequestMutation();
useEffect(() => {
if (userData) {
if (userData?.id) {
getInvites({
variables: {
userId: userData.id,
userId: userData?.id,
},
});
}
}, [asPath, userData, getInvites]);
}, [asPath, userData?.id, getInvites]);
useEffect(() => {
const checkForPendingOrgRequests = async () => {
const { data: { organizationNewRequests = [] } = {} } =
await getOrganizationNewRequests({
variables: {
userID: userData.id,
userID: userData?.id,
},
});
if (organizationNewRequests.length > 0) {
@@ -111,6 +113,7 @@ export default function NotificationsTray() {
};
if (
isPlatForm &&
userData &&
!['/', '/orgs/verify'].includes(route) &&
isRouterReady &&
@@ -125,6 +128,7 @@ export default function NotificationsTray() {
getOrganizationNewRequests,
postOrganizationRequest,
session_id,
isPlatForm,
]);
const [acceptInvite] = useOrganizationMemberInviteAcceptMutation();

View File

@@ -48,6 +48,7 @@ import {
SelectTrigger,
SelectValue,
} from '@/components/ui/v3/select';
import { useUserData } from '@/hooks/useUserData';
import {
Organization_Members_Role_Enum,
useDeleteOrganizationMemberMutation,
@@ -55,7 +56,6 @@ import {
type GetOrganizationQuery,
} from '@/utils/__generated__/graphql';
import { zodResolver } from '@hookform/resolvers/zod';
import { useUserData } from '@nhost/nextjs';
import { Ellipsis } from 'lucide-react';
import { useRouter } from 'next/router';
import { useState } from 'react';
@@ -76,7 +76,7 @@ const updateMemberRoleFormSchema = z.object({
export default function OrgMember({ member, isAdmin }: OrgMemberProps) {
const { maintenanceActive } = useUI();
const { id } = useUserData();
const user = useUserData();
const { push } = useRouter();
const { refetch: refetchOrgs } = useOrgs();
const { org: { plan: { isFree } = {} } = {}, refetch: refetchCurrentOrg } =
@@ -87,7 +87,7 @@ export default function OrgMember({ member, isAdmin }: OrgMemberProps) {
const [updateMemberRoleDialogOpen, setUpdateMemberRoleDialogOpen] =
useState(false);
const isSelf = id === member.user.id;
const isSelf = user?.id === member.user.id;
const [deleteMember] = useDeleteOrganizationMemberMutation({
variables: {
@@ -98,7 +98,7 @@ export default function OrgMember({ member, isAdmin }: OrgMemberProps) {
const handleRemoveMemberFromOrg = async () => {
await execPromiseWithErrorToast(
async () => {
const isRemovingSelf = id === member.user.id;
const isRemovingSelf = user?.id === member.user.id;
await deleteMember();
// TODO see if it makes sense to unify both of these
await refetchCurrentOrg();
@@ -191,7 +191,7 @@ export default function OrgMember({ member, isAdmin }: OrgMemberProps) {
<DropdownMenu open={dropDownOpen} onOpenChange={setDropDownOpen}>
<DropdownMenuTrigger
disabled={
(!isAdmin && id !== member.user.id) ||
(!isAdmin && user?.id !== member.user.id) ||
isFree ||
maintenanceActive
}

View File

@@ -50,7 +50,7 @@ function ProjectCard({ project }: { project: Project }) {
}
export default function ProjectsGrid() {
const { org } = useCurrentOrg();
const { org, loading: orgLoading } = useCurrentOrg();
const { data, loading, error } = useGetProjectsQuery({
variables: {
@@ -76,7 +76,7 @@ export default function ProjectsGrid() {
throw error;
}
if (loading) {
if (loading || orgLoading) {
return <LoadingScreen />;
}

View File

@@ -1,10 +1,10 @@
import { execPromiseWithErrorToast } from '@/features/orgs/utils/execPromiseWithErrorToast';
import { useAuth } from '@/providers/Auth';
import {
CheckoutStatus,
type PostOrganizationRequestMutation,
usePostOrganizationRequestMutation,
} from '@/utils/__generated__/graphql';
import { useAuthenticationStatus } from '@nhost/nextjs';
import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';
@@ -24,7 +24,7 @@ function useFinishOrgCreation({
const router = useRouter();
const { session_id } = router.query;
const { isAuthenticated } = useAuthenticationStatus();
const { isAuthenticated } = useAuth();
const [loading, setLoading] = useState(false);
const [postOrganizationRequest] = usePostOrganizationRequestMutation();
const [status, setPostOrganizationRequestStatus] =

View File

@@ -1,6 +1,6 @@
import { useCurrentOrg } from '@/features/orgs/projects/hooks/useCurrentOrg';
import { useUserData } from '@/hooks/useUserData';
import { Organization_Members_Role_Enum } from '@/utils/__generated__/graphql';
import { useUserData } from '@nhost/nextjs';
export default function useIsOrgAdmin() {
const { org: { members = [] } = {} } = useCurrentOrg();

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