Commit Graph

149 Commits

Author SHA1 Message Date
David Nguyen 824f4a070a feat: demo 2024-03-27 20:31:08 +08:00
David Nguyen 2c8d11c37d fix: demo 2024-03-26 22:42:38 +08:00
David Nguyen 006b732edb fix: update document flow fetch logic (#1039)
## Description

**Fixes issues with mismatching state between document steps.**

For example, editing a recipient and proceeding to the next step may not
display the updated recipient. And going back will display the old
recipient instead of the updated values.

**This PR also improves mutation and query speeds by adding logic to
bypass query invalidation.**

```ts
export const trpc = createTRPCReact<AppRouter>({
  unstable_overrides: {
    useMutation: {
      async onSuccess(opts) {
        await opts.originalFn();

        // This forces mutations to wait for all the queries on the page to reload, and in
        // this case one of the queries is `searchDocument` for the command overlay, which
        // on average takes ~500ms. This means that every single mutation must wait for this.
        await opts.queryClient.invalidateQueries(); 
      },
    },
  },
});
```

I've added workarounds to allow us to bypass things such as batching and
invalidating queries. But I think we should instead remove this and
update all the mutations where a query is required for a more optimised
system.

## Example benchmarks

Using stg-app vs this preview there's an average 50% speed increase
across mutations.

**Set signer step:**
Average old speed: ~1100ms
Average new speed: ~550ms

**Set recipient step:**
Average old speed: ~1200ms
Average new speed: ~600ms

**Set fields step:**
Average old speed: ~1200ms
Average new speed: ~600ms

## Related Issue

This will resolve #470

## Changes Made

- Added ability to skip batch queries
- Added a state to store the required document data.
- Refetch the data between steps if/when required
- Optimise mutations and queries

## Checklist

- [X] I have tested these changes locally and they work as expected.
- [X] I have followed the project's coding style guidelines.

---------

Co-authored-by: Lucas Smith <me@lucasjamessmith.me>
2024-03-26 21:12:41 +08:00
David Nguyen 5210fe2963 feat: add passkeys (#989)
## Description

Add support to login with passkeys.

Passkeys can be added via the user security settings page.

Note: Currently left out adding the type of authentication method for
the 'user security audit logs' because we're using the `signIn`
next-auth event which doesn't appear to provide the context. Will look
into it at another time.

## Changes Made

- Add passkeys to login
- Add passkeys feature flag
- Add page to manage passkeys
- Add audit logs relating to passkeys
- Updated prisma schema to support passkeys & anonymous verification
tokens

## Testing Performed

To be done.

MacOS:
- Safari  
- Chrome  
- Firefox 

Windows:
- Chrome [Untested] 
- Firefox [Untested]

Linux:
- Chrome [Untested]
- Firefox [Untested]

iOS:
- Safari 

## Checklist

<!--- Please check the boxes that apply to this pull request. -->
<!--- You can add or remove items as needed. -->

- [X] I have tested these changes locally and they work as expected.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Introduced Passkey authentication, including creation, sign-in, and
management of passkeys.
- Added a Passkeys section in Security Settings for managing user
passkeys.
- Implemented UI updates for Passkey authentication, including a new
dialog for creating passkeys and a data table for managing them.
- Enhanced security settings with server-side feature flags to
conditionally display new security features.
- **Bug Fixes**
	- Improved UI consistency in the Settings Security Activity Page.
- Updated button styling in the 2FA Recovery Codes component for better
visibility.
- **Refactor**
- Streamlined authentication options to include WebAuthn credentials
provider.
- **Chores**
- Updated database schema to support passkeys and related functionality.
	- Added new audit log types for passkey-related activities.
- Enhanced server-only authentication utilities for passkey registration
and management.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-03-26 21:11:59 +08:00
David Nguyen 43400c07de feat: remove 2FA password requirement (#1053) 2024-03-25 11:34:50 +08:00
Mythie 73aae6f1e3 feat: improve admin panel 2024-03-03 01:55:33 +11:00
Lucas Smith 00c36782ff fix: why didn't prettier catch this 2024-03-01 22:59:52 +11:00
McPizza 665ccd7628 update username min characters 2024-03-01 11:30:42 +00:00
McPizza e5fe3d897d remove fixed true condition
from auth signup router
2024-03-01 11:27:24 +00:00
Mythie 9f576eb47c fix: update signup mutation schema 2024-02-29 14:13:37 +11:00
Lucas Smith 5576cdc2b0 Merge branch 'main' into feat/public-profile-1 2024-02-29 14:08:19 +11:00
Mythie ecc9dc63ea feat: the rest of the owl 2024-02-29 13:22:21 +11:00
Mythie e3e2cfbcfd fix: refactor and implement design 2024-02-28 14:43:09 +11:00
Adithya Krishna b498f8edb7 feat: update ui
Signed-off-by: Adithya Krishna <adithya@documenso.com>
2024-02-27 20:40:42 +11:00
Adithya Krishna 65d762dd4b feat: update signin signup ui
Signed-off-by: Adithya Krishna <adithya@documenso.com>
2024-02-27 20:39:19 +11:00
Mythie a4b1f7c983 feat: support team webhooks 2024-02-27 16:56:32 +11:00
Mythie c2daa964c0 chore: use cuids for webhooks 2024-02-27 12:13:56 +11:00
Lucas Smith 5805d8a903 Merge branch 'main' into feat/webhook-implementation 2024-02-26 12:47:21 +11:00
Lucas Smith 3c51a1bc3d Merge branch 'main' into feat/public-api 2024-02-26 12:15:33 +11:00
Lucas Smith fcfb741363 feat: edit recipients when creating document from template (#953)
https://github.com/documenso/documenso/assets/55143799/85a840e3-4fb4-4c02-ba63-b9626f4cea58
2024-02-26 12:00:23 +11:00
Mythie a54159a9ec fix: add missing teamId references 2024-02-26 11:59:32 +11:00
Mythie 6b8e11b535 fix: template router update 2024-02-26 10:31:24 +11:00
Mythie c7dac2f4de fix: update delete endpoint and add limits 2024-02-26 10:01:13 +11:00
Lucas Smith 2a74ce06ef Merge branch 'main' into feat/public-api 2024-02-26 00:21:25 +11:00
Lucas Smith 9cf72e1442 chore: tidy code and extract alert-dialog 2024-02-25 11:12:18 +00:00
Lucas Smith 7226d5ac53 Merge branch 'main' into feat/account-deletion 2024-02-24 23:18:14 +11:00
Lucas Smith a5e51e63a1 Merge branch 'main' into custom-text-field 2024-02-24 22:23:17 +11:00
Lucas Smith a10957d909 Merge branch 'main' into feat/improve-create-document-from-template 2024-02-24 21:26:11 +11:00
Lucas Smith b1b3b84d82 Merge branch 'main' into feat/template-recipient-roles 2024-02-24 21:01:45 +11:00
Lucas Smith 8165a090d1 feat: migrate to site-settings 2024-02-23 10:47:01 +00:00
Ephraim Atta-Duncan c436559787 feat: create a banner with custom text by admin 2024-02-22 20:20:49 +00:00
David Nguyen 34825aaf3a feat: add separate document audit page 2024-02-22 19:14:01 +11:00
David Nguyen 48321f2f62 Merge branch 'main' into feat/separate-document-page 2024-02-22 16:13:33 +11:00
Mythie 2abcdd7533 feat: team api tokens 2024-02-22 13:39:34 +11:00
Lucas Smith 22e3a79a72 Merge branch 'main' into feat/public-api 2024-02-21 11:29:36 +11:00
Ephraim Atta-Duncan 6ee896048e feat: dialog to enter custom recipients for creating document from template 2024-02-20 19:11:12 +00:00
Ephraim Atta-Duncan 11299d3f92 feat: add custom text to singleplayer 2024-02-17 11:24:47 +00:00
Catalin Pit 4d6e780abe chore: merge main 2024-02-16 12:12:54 +02:00
Lucas Smith fe2093fe7c feat: add next-runtime-env (#869)
This PR adds the package
[next-runtime-env](https://github.com/expatfile/next-runtime-env/) to
populate the public environment variables at runtime.
2024-02-15 22:10:21 +11:00
David Nguyen bd3c64658a feat: add document version history UI 2024-02-15 20:39:26 +11:00
Ephraim Atta-Duncan 769eaa0ed9 feat: add roles to templates recipients 2024-02-15 07:01:41 +00:00
Ephraim Atta-Duncan c680cfc24f chore: update pr based on review 2024-02-14 14:55:46 +00:00
Ephraim Duncan 6daaa3a6d4 Merge branch 'main' into feat/account-deletion 2024-02-14 14:54:26 +00:00
Catalin Pit 61958989b4 feat: more webhook functionality 2024-02-14 14:38:58 +02:00
Lucas Smith 536cafde31 Merge branch 'main' into feat/disable-access-unverified-users 2024-02-13 20:19:16 +11:00
David Nguyen b1bb345929 fix: redirect URL preventing document flow (#925)
## Description

Currently the document redirect URL feature is preventing documents from
being created unless a redirect URL is provided.

During the document edit flow, the redirect URL is hidden in an advanced
tab with the value of an empty string, which will always fail the
current Zod validation since `optional` requires undefined to pass.

There are multiple ways to fix this, but I think this is the easiest
method where we can assume an empty string is valid.
2024-02-12 15:23:15 +11:00
Lucas Smith 8ebef831ac Merge branch 'main' into feat/add-runtime-env 2024-02-12 12:30:35 +11:00
David Nguyen 3a32bc62c5 feat: initial document audit logs implementation (#922)
Added initial implementation of document audit logs.
2024-02-12 12:04:53 +11:00
Catalin Pit 0209127136 feat: delete webhook functionality 2024-02-09 16:28:18 +02:00
Catalin Pit ddb9dd11d7 feat: added backend stuff 2024-02-09 16:07:33 +02:00