Compare commits

..

764 Commits

Author SHA1 Message Date
Adithya Krishna
86788f4248 feat: added password validation (#469)
This PR Fixes #464
2024-01-30 11:42:52 +11:00
hallidayo
76c203aae6 feat: dateformat and timezone customization (#506) 2023-12-27 10:50:40 +11:00
18feb06
bb5611ad40 feat: added undo button while drawing signature (#480) 2023-12-16 13:20:59 +11:00
Aditya Deshlahre
b152dbe25e chore: add lint-staged task for dependency changes (#548) 2023-12-09 11:30:15 +11:00
Lucas Smith
3db67c1212 chore: use minio as s3 storage for document during development (#588) 2023-12-08 20:49:08 +11:00
Lucas Smith
dc8224ee9f fix: update container name 2023-12-08 20:48:25 +11:00
Nafees Nazik
8d0e815b0f feat: add two factor auth (#643)
Add two factor authentication for users who wish to enhance the security of their accounts.
2023-12-01 11:22:16 +11:00
Catalin Pit
65cc26fd02 feat: email verification for registration (#599) 2023-11-21 15:42:29 +11:00
Adithya Krishna
9b9b8a85e7 feat: add dark mode toggle (#529) 2023-11-17 16:58:27 +11:00
Ephraim Atta-Duncan
852fc7ed7a chore: use database as default for example env 2023-11-16 07:59:28 +00:00
Nafees Nazik
51938293f1 feat: enable resend email menu (#496) 2023-11-16 13:05:45 +11:00
Ephraim Atta-Duncan
34527c1842 fix: fetch the correct number of open issues using the github search api (#495) 2023-11-15 18:16:43 +11:00
Nafees Nazik
e3b589516b feat: cache getServerComponentSession calls (#644) 2023-11-14 20:37:39 +11:00
SAHIL SIRAJALI KAZI
1dd3a398d8 fix: safari pdf overflow issue fixed (#466) 2023-11-14 20:24:33 +11:00
Nafees Nazik
587433fcd5 feat: limit document upload size (#347) 2023-11-14 20:07:55 +11:00
Nafees Nazik
c2d7954467 chore: add some eslint rules (#344) 2023-11-14 20:01:45 +11:00
Ephraim Atta-Duncan
1c3cdf3165 feat: add dialog to confirm signing (#342) 2023-11-14 16:56:43 +11:00
Nafees Nazik
d2a6cbd681 feat: use nextjs.js standalone output for improvised docker image (#338) 2023-11-10 17:41:49 +11:00
Nafees Nazik
dc3d85f1a2 feat: add command menu and keyboard shortcuts (#337) 2023-11-08 22:36:12 +11:00
sean-brydon
b4f4f4fc72 feat: duplicate document (#633) 2023-11-08 20:25:44 +11:00
Timur Ercan
24440c5cc4 Single Player Mode on Product Hunt
🚨 We are live on Product Hunt with Single Player Mode and the new free tier: [https://www.producthunt.com/products/documenso](https://www.producthunt.com/posts/documenso-singleplayer-mode)
2023-11-06 10:20:35 +01:00
Thomas Kaul
c20397206a fix: typo in README.md (#630) 2023-11-06 12:18:24 +11:00
Mythie
d686dcfa90 chore: include total and new user charts 2023-11-06 11:57:38 +11:00
Mythie
dcee4eff58 fix: add white background for og images 2023-11-05 12:49:37 +11:00
Mythie
48d7afe9f4 fix: add white background for og images 2023-11-05 12:49:04 +11:00
Mythie
3009088b0e feat: show monthly new users 2023-11-05 12:48:05 +11:00
David Nguyen
db01b1afdd fix: correctly sign SPM documents (#627)
- Sign and email correct SPM document
- Optimise signing SPM documents
2023-11-04 14:39:33 +11:00
Mythie
53a323ccf8 fix: dont use custom documentData for single player mode 2023-11-04 13:27:09 +11:00
Mythie
76c8dfa907 fix: updates from error logs 2023-11-04 13:27:09 +11:00
Adithya Krishna
16af21ba25 fix: hiding of action buttons (#460)
* chore: fix hiding of action buttons
2023-11-03 16:39:43 +11:00
Mythie
57ad16cc10 feat: add completed at timestamp 2023-11-03 15:48:40 +11:00
Anik Dhabal Babu
edfc67c050 fix: small typo error (#584) 2023-11-03 12:58:09 +11:00
Abhinav
1f953457db fix: days filter working (#623) 2023-11-03 12:34:11 +11:00
David Nguyen
b5ec13eba1 chore: update bug report template (#580) 2023-11-03 11:45:15 +11:00
Timur Ercan
bf87800fbf Update README.md 2023-11-02 21:20:49 +01:00
Anupam
f078dd2f6c fix: added the share btn in the UI and prewarm fetch (#615) 2023-11-02 13:38:34 +11:00
Catalin Pit
1e4f1ad4ae fix: seal document for single player mode (#617) 2023-11-02 12:47:19 +11:00
18feb06
5bae42cf0f feat: improving incorrect default signature behaviour #594 (#600) 2023-11-01 19:39:21 +11:00
Anik Dhabal Babu
ee003e45b4 fix: improve the early adopters plan input section (#609) 2023-11-01 09:54:38 +11:00
Ephraim Atta-Duncan
2f718edf9b docs: re-add launch week 5 blogpost (#614) 2023-11-01 09:51:01 +11:00
vimode
09b956825f fix: typos and grammatical errors in readme (#616) 2023-11-01 09:50:35 +11:00
Sachin M Mane
b576d6cede chore:  Improved the issue templates with issue forms (supported viayml ) (#612)
GitHub supports the issue forms [1].
[1] https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#creating-issue-forms

This feature allows users to create issues using a structured and visually appealing form. This functionality is facilitated through a  file for the issue template.

Added the issue template for bug report, feature request, and improvement by adding respective  file. Also, removed previous  file which is no longer needed
2023-10-31 08:54:51 +02:00
18feb06
dbff10e3de fix: page-not-found at share page for document signed in single-player-mode #605 (#606) 2023-10-31 08:54:16 +02:00
Mythie
34e707b925 fix: invalid url with cloudfront 2023-10-31 12:50:47 +11:00
Mythie
dba4c31ce3 feat: support cloudfront presign 2023-10-31 12:19:16 +11:00
Mythie
9f5ee0d9ac feat: add database indexes 2023-10-30 16:58:51 +11:00
Mythie
64d6923e05 chore: remove malfunction mania and feat/refresh from readme 2023-10-30 16:53:14 +11:00
Mythie
3c6196f49c feat: add user schema timestamps 2023-10-28 20:57:26 +11:00
Shivam Bhatnagar
7ee9cb3f93 fix(web): fix typo + refactor empty state messages (#583)
* fix(web): fix typo + refactor empty state messages

* fix(web): refactor default empty-state message
2023-10-27 13:05:10 +03:00
Lucas Smith
f05cc2e652 Merge pull request #591 from olivierlambert/feat/refresh
feat: update the README for the self-hosting users
2023-10-27 15:59:22 +11:00
Lucas Smith
a047e230b9 Merge pull request #595 from adithyaakrishna/feat/slack2Discord
chore: updated slack to discord links
2023-10-27 15:58:24 +11:00
Lucas Smith
c98a860140 fix: add back slack support 2023-10-27 15:57:31 +11:00
Lucas Smith
f7a64eb97b Merge pull request #598 from documenso/chore/next-14
chore: upgrade to next 14.0.0
2023-10-27 15:52:56 +11:00
Mythie
dc5a1819f1 chore: upgrade to next 14.0.0 2023-10-27 15:14:04 +11:00
Adithya Krishna
b75e50065e chore: updated slack to discord links
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
2023-10-26 11:37:10 +05:30
Mythie
ef8fcd4ea9 fix: missing content updates 2023-10-26 16:58:42 +11:00
Mythie
bf3747cd7b fix: change sign in links 2023-10-26 16:40:25 +11:00
Mythie
3ff8a99250 fix: update early adopter error log 2023-10-26 14:26:10 +11:00
Mythie
fb64496c7d fix: update stripe metadata for early adopters 2023-10-26 13:21:31 +11:00
Mythie
407fa0047c fix: update limits handler 2023-10-26 12:26:29 +11:00
Mythie
a2902ee7c0 fix: attach document to completed email 2023-10-25 22:34:51 +11:00
Mythie
7599b84833 fix: limit recipients 2023-10-25 22:31:31 +11:00
Mythie
769f543be1 fix: improve claim plan flow 2023-10-25 22:29:51 +11:00
Mythie
d6447ffa82 fix: return response for failed invoices 2023-10-25 13:29:00 +11:00
Mythie
f29ac73085 fix: update customer handling for checkouts 2023-10-25 13:13:57 +11:00
Olivier Lambert
cb61898764 feat: update the README for the self-hosting users
Signed-off-by: Olivier Lambert <olivier.lambert@vates.fr>
2023-10-23 15:44:28 +02:00
Ephraim Atta-Duncan
1d632200d7 chore: use minio as s3 storage for document during development 2023-10-23 00:55:40 +00:00
Mythie
fd8f6da2c6 fix: update singleplayer add signature to card 2023-10-22 12:40:09 +11:00
Mythie
0b50176178 fix: limits no longer cache during session changes 2023-10-22 11:18:00 +11:00
Mythie
c02640e104 fix: optimise pdf viewer rerendering 2023-10-21 13:08:29 +11:00
Mythie
091960f269 fix: unbreak pdf viewer 2023-10-20 20:14:10 +11:00
Mythie
594f3ec16a fix: move getFile to client side 2023-10-20 13:42:10 +11:00
Mythie
a89da06842 fix: update webhook handler 2023-10-20 12:14:39 +11:00
Mythie
db1d11309f fix: update webhook handler 2023-10-20 12:05:18 +11:00
Adithya Krishna
616cf1c287 chore: update zod to 3.22.4 (#563)
* chore: updated zod 

Signed-off-by: Adithya Krishna <aadithya794@gmail.com>

---------

Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
2023-10-19 21:24:05 +11:00
Udit Takkar
ba665edb1e fix: UI fixes and improvements (#559)
* chore: add cursor pointer

* fix: tooltip color

* chore: add tooltip

* fix: admin pages in mobile
2023-10-19 21:00:36 +11:00
Catalin Pit
1c34eddd10 chore: add prisma studio command (#576)
Co-authored-by: pit <pit@pits-MacBook-Pro.local>
2023-10-19 09:19:46 +03:00
Mythie
1fbf6ed4ba fix: add mode to checkout session 2023-10-19 12:27:01 +11:00
Aditya Deshlahre
1d6f7f9e37 fix(bug): name field can be updated with spaces #555 (#558) 2023-10-19 12:12:56 +11:00
Mythie
e3c3ec7825 fix: downgrade react-pdf 2023-10-18 23:51:16 +11:00
Lucas Smith
08d176c803 Merge pull request #575 from 18feb06/fix-error-invalid-url-on-main-page-on-self-host-#573
fix: error invalid url on main page on self host #573
2023-10-18 23:20:22 +11:00
Mythie
b952ed9035 fix: support multi env 2023-10-18 23:19:29 +11:00
Nafees Nazik
43062dda12 chore: upgrade to latest next.js version (#553)
* chore: upgrade next.js
* fix: canvas not found error
* chore: upgrade package for marketing
* feat: add isServer conditional
* fix: inverse isServer condition
* fix: normalize packages
* fix: upgrade ee package
* fix: depdency nightmares
* fix: failing seed script
2023-10-18 22:33:02 +11:00
18feb06
1b53ff9c2d Merge branch 'documenso:feat/refresh' into fix-error-invalid-url-on-main-page-on-self-host-#573 2023-10-18 16:30:57 +05:00
Tameem Asim
acd3e6d613 fix: invalid url on main page in self host 2023-10-18 16:28:57 +05:00
Catalin Pit
e33b02df56 fix: truncate long file name in admin dashboard (#572)
Co-authored-by: pit <pit@192-168-0-136.rdsnet.ro>
2023-10-18 08:58:35 +03:00
18feb06
2c6849ca76 fix: email requesting signature shows "completed document" in preview… (#514) 2023-10-18 15:32:39 +11:00
Abhinav-Developer-23
9434f9e2e4 fix: support mailto link fix (#571) 2023-10-17 17:27:02 +11:00
Lucas Smith
f6daef7333 Merge pull request #566 from documenso/feat/plan-limits
feat: plan limits
2023-10-17 14:30:18 +11:00
Mythie
c3df8d4c2a fix: add redirects for v0.9 requests 2023-10-17 13:50:54 +11:00
David Nguyen
4b09693862 feat: add safari clipboard copy support (#486) 2023-10-17 12:40:36 +11:00
Catalin Pit
8d2e50d1fe fix: user avatar on admin documents table (#570)
Co-authored-by: pit <pit@pits-MacBook-Pro.local>
2023-10-16 17:36:12 +03:00
Abhinav-Developer-23
bfc749f30b fix: fix for Accepting signatures or text fields with white space only #551 (#557) 2023-10-16 20:08:45 +11:00
Udit Takkar
e0d4255700 fix: enable dragging fields (#565) 2023-10-16 19:50:28 +11:00
Mythie
6ba4ff1c17 fix: build errors 2023-10-16 17:38:41 +11:00
Mythie
652af26754 fix: exports on next page 2023-10-15 20:32:36 +11:00
Mythie
093488a67c feat: plan limits 2023-10-15 20:26:32 +11:00
Mythie
0d026f3476 fix: filter out inactive products 2023-10-14 13:02:36 +11:00
Lucas Smith
3e89ec1afc Merge pull request #384 from documenso/feat/stripe-free-tier
feat: add Stripe free tier subscription
2023-10-14 12:22:31 +11:00
Lucas Smith
df0d18fc81 Merge pull request #502 from documenso/feat/add-e2e-testing-playwright
feat: add playwright
2023-10-14 12:21:18 +11:00
Catalin Pit
dd25c355ff Merge pull request #396 from documenso/feat/admin-ui-manage-instance 2023-10-13 18:18:24 +03:00
Timur Ercan
6f851833b2 Merge branch 'feat/refresh' into feat/admin-ui-manage-instance 2023-10-13 16:44:44 +02:00
Lucas Smith
442b089d7f fix: style updates 2023-10-14 00:20:11 +11:00
Lucas Smith
1c58b21383 Merge branch 'feat/refresh' into feat/add-e2e-testing-playwright 2023-10-14 00:13:41 +11:00
Lucas Smith
a6e13faf7b fix: quick tweaks 2023-10-13 13:08:39 +00:00
Mythie
ede9eb052d fix: named exports 2023-10-13 23:56:11 +11:00
Lucas Smith
fab006078c Merge pull request #554 from documenso/fix/cascade-delete-share-links
fix: add cascade delete for share links
2023-10-13 23:41:13 +11:00
Mythie
4d5275f915 fix: create custom pricing table 2023-10-13 23:33:40 +11:00
pit
901e83af58 chore: implemented feedback 2023-10-13 12:16:07 +03:00
pit
e1bee1591f chore: implemented feedback 2023-10-13 11:48:52 +03:00
David Nguyen
a354c23231 feat: add document share button to marketing (#422) 2023-10-13 14:14:13 +11:00
David Nguyen
f728dd13c5 fix: add cascade delete for share links 2023-10-13 12:45:39 +11:00
pit
7927b87259 chore: polished code 2023-10-12 17:07:54 +03:00
pit
55301a9d53 chore: revert back env file name 2023-10-12 12:49:39 +03:00
pit
c0dd57a4d2 chore: implement feedback 2023-10-12 12:19:23 +03:00
pit
cc80773402 chore: implement feedback 2023-10-12 11:44:16 +03:00
David Nguyen
c803d2c4ba feat: single-player-mode-polish (#435) 2023-10-12 18:10:52 +11:00
Udit Takkar
eb5f5f7a90 fix: background color of signature page (#487) 2023-10-12 14:08:26 +11:00
Abhinav-Developer-23
2ea5ff2c94 fix: bypass signature fix (#536) (#547) 2023-10-12 11:33:01 +11:00
pit
bc9a6fa50a chore: implemented feedback 2023-10-11 16:20:04 +03:00
pit
e02ab7d256 chore: implement pr feedback 2023-10-11 12:32:33 +03:00
Lucas Smith
01e6367b72 Merge branch 'feat/refresh' into feat/stripe-free-tier 2023-10-11 17:24:01 +11:00
Lucas Smith
565602f8e1 Merge pull request #530 from anikdhabal/issue#518
fix: Add gitpod configuration
2023-10-11 16:56:59 +11:00
pit
9e0d281883 chore: feedback fix 2023-10-10 16:52:58 +03:00
pit
67629dd735 chore: fix eslint issues 2023-10-10 13:57:07 +03:00
pit
2a89278c7b chore: merge feat/refresh 2023-10-10 13:53:22 +03:00
pit
8f4ba6eb8a chore: self-review 2023-10-10 13:50:50 +03:00
Catalin Pit
8dfcfb99e0 Merge branch 'feat/refresh' into feat/add-e2e-testing-playwright 2023-10-10 11:49:00 +03:00
pit
1299aa51ee chore: move fetching in data-table-users 2023-10-10 11:44:16 +03:00
Nafees Nazik
e0271cace3 feat: delete draft document (#491) 2023-10-10 13:55:58 +11:00
pit
a11440a7f3 chore: tidy up 2023-10-09 13:30:28 +03:00
Anik Dhabal Babu
cc8c4b8297 Merge branch 'feat/refresh' into issue#518 2023-10-09 15:21:33 +05:30
Mythie
a287aab4f4 chore: disable dependabot for now 2023-10-09 20:35:19 +11:00
pit
4c518df60d chore: remove generic data table 2023-10-09 12:02:55 +03:00
pit
d4ae733e9e chore: add transition and check for empty users array 2023-10-09 11:59:08 +03:00
Lucas Smith
b5ed703553 Merge pull request #545 from anikdhabal/fix_dotenv-cli
fix: mismatch the version of dotenv-cli
2023-10-09 19:49:07 +11:00
Anik Dhabal Babu
f49880125a fix: mismatch the version of dotenv-cli 2023-10-09 08:41:13 +00:00
Anik Dhabal Babu
8380c357d9 Merge branch 'feat/refresh' into issue#518 2023-10-09 10:03:58 +05:30
Anik Dhabal Babu
4e010c5624 fix : add gittpod configuration 2023-10-09 09:58:12 +05:30
hallidayo
f53cdbace9 fix: frequency focus ring (#533) 2023-10-09 12:04:01 +11:00
Lucas Smith
b4d04e2ce9 Merge pull request #516 from adityadeshlahre/feat/refresh
fix(script): [fix : DOC-36] Use dotenv for Prisma package scripts #523
2023-10-09 10:12:08 +11:00
Mythie
2470aeee1f fix: update script, docs and devcontainer 2023-10-08 21:51:15 +11:00
Lucas Smith
fd07b47325 Merge pull request #526 from mittalsam98/fix/507-signature-modal-center-align
fix: non responsiveness of Add your sign modal
2023-10-07 22:31:18 +11:00
Lucas Smith
9257a05831 Merge pull request #527 from documenso/docs/render-deploy
docs: add render one click deploy for refresh
2023-10-07 22:25:42 +11:00
Ephraim Atta-Duncan
1faa6f2944 Merge pull request #528 from documenso/chore/github-templates 2023-10-07 02:35:35 +00:00
Ephraim Atta-Duncan
5584bbe9ca Merge branch 'feat/refresh' into chore/github-templates 2023-10-07 02:07:54 +00:00
Anik Dhabal Babu
cc65537ea3 fix: Add gitpod configuration 2023-10-06 23:03:13 +05:30
pit
5f14f87406 feat: filter users by name or email 2023-10-06 15:48:05 +03:00
Anik Dhabal Babu
04a80b7c03 fix: add gitpod configuration 2023-10-06 11:06:34 +05:30
pit
2b44e54d99 feat: subscriptions and documents page 2023-10-05 18:35:12 +03:00
Anik Dhabal Babu
c71a89d1b7 fix: Add gitpod configuration 2023-10-05 12:21:34 +00:00
Aditya Deshlahre
e2abfd2312 Merge branch 'documenso:feat/refresh' into feat/refresh 2023-10-05 15:46:14 +05:30
Anjy Gupta
49d55227e8 fix: sign up with existing account email bug (#517)
* fix: sign up with existing account email bug
2023-10-05 20:59:43 +11:00
Aditya @ArchLinux
0dadec3b8d fix(script): minor change on scipt 2023-10-05 15:26:53 +05:30
Aditya Deshlahre
e2d8591d66 Merge branch 'documenso:feat/refresh' into feat/refresh 2023-10-05 15:19:42 +05:30
pit
aecc703317 chore: remove this branch 2023-10-05 12:11:17 +03:00
pit
2422c3e7be chore: update e2e tests 2023-10-05 11:56:32 +03:00
pit
4e1994a0c8 chore: update import 2023-10-05 11:46:45 +03:00
pit
a3dce67117 chore: changes 2023-10-05 11:38:51 +03:00
pit
64dcd451e9 chore: add schema location 2023-10-05 10:56:09 +03:00
pit
a85523ecfc chore: change from npm to npx 2023-10-05 10:53:19 +03:00
pit
85b32bb15b chore: install prisma before prisma client 2023-10-05 10:24:03 +03:00
pit
742ad86b10 chore: add remote caching 2023-10-05 10:13:43 +03:00
pit
39ff11a59d chore: use env vars for tests 2023-10-05 09:12:56 +03:00
pit
4f5976479a chore: merge feat/refresh 2023-10-05 08:47:03 +03:00
zahid47
eac7aa84b0 fix: add defaultValue to SignaturePad to persist signatures (#522)
* fix: add defaultValue to SignaturePad to persist signatures
2023-10-05 12:54:52 +11:00
hallidayo
bd941202c8 changed text of stepper (#513) 2023-10-05 11:25:09 +11:00
Ephraim Atta-Duncan
b854f0eedc chore: add pull request templates 2023-10-04 20:05:55 +00:00
Ephraim Atta-Duncan
1814bd4167 chore: add issue template 2023-10-04 20:04:10 +00:00
Ephraim Atta-Duncan
b6f9d70fec docs: add render one click deploy for refresh 2023-10-04 19:58:07 +00:00
Sachin
7c54913bf5 fix: non responsiveness of Add your sign modal 2023-10-05 00:09:30 +05:30
Timur Ercan
e8d5044ac5 chore: typos
typos
2023-10-04 19:12:30 +02:00
Aditya @ArchLinux
ddf097ede3 Merge branch 'adityadeshlahre/documenso' into feat/refresh 2023-10-04 20:05:33 +05:30
Aditya Deshlahre
1bad85e1d6 Merge branch 'documenso:feat/refresh' into feat/refresh 2023-10-04 20:04:48 +05:30
Aditya @ArchLinux
68458b50d2 fix(script): added script envprisma in root package.json
dotenv loads all environment variable before running prisma:migrate-dev script
2023-10-04 20:04:07 +05:30
David Nguyen
e00f28cf87 chore: add code of conduct (#521)
Update contributing guidelines
2023-10-04 18:38:59 +11:00
Aditya Deshlahre
4cc34ec50a Merge branch 'documenso:feat/refresh' into feat/refresh 2023-10-04 13:00:52 +05:30
Udit Takkar
693249916d feat: require old password for password reset (#488)
* feat: require old password for password reset
2023-10-04 15:23:57 +11:00
Anik Dhabal Babu
381a248543 fix: update icons (#468)
* fix: update icons
2023-10-04 13:27:36 +11:00
Aditya @ArchLinux
f637381198 style(ui/ux): added margin to dialogprimitive.content & dialogprimitive.close (m-4) 2023-10-04 01:39:16 +05:30
Timur Ercan
071335cc66 Merge pull request #504 from documenso/chore/team
chore: add new team members
2023-10-03 14:42:26 +02:00
Timur Ercan
4d4b011146 chore: add new team members 2023-10-03 14:04:29 +02:00
pit
d10713b477 ci: trigger ci 2023-10-03 10:21:48 +01:00
pit
2efaabd2c3 ci: trigger ci 2023-10-03 10:20:39 +01:00
pit
7bc1e9dcc8 chore: add env step in gh action 2023-10-03 10:19:54 +01:00
pit
8848df701c chore: added delete function 2023-10-03 10:09:40 +01:00
pit
2e800d0eed chore: removed lint step 2023-10-03 10:01:44 +01:00
pit
70ecc9a4a8 feat: add playwright 2023-10-03 09:53:47 +01:00
Harsh Acharya
97dfacd133 fix: Error in Pricing Page Validation for Signup Now Modal (#497)
* fix: signup modal validation on close
* fix: restore auto focus input
2023-10-03 18:26:33 +11:00
Arjun Bharti
87a5bab734 fix: signature text overflow truncated for longer signature texts (#489) 2023-10-03 16:58:11 +11:00
pit
b5fc6e1aaf feat: manage documents admin ui 2023-10-02 16:55:04 +01:00
pit
87f70fa290 feat: profile page done 2023-10-02 11:38:04 +01:00
Lucas Smith
fa61bb660e Merge pull request #438 from documenso/chore/team
chore: and now his watch has ended
2023-10-01 15:41:52 +11:00
Mythie
83dd079e03 fix: remove unused imports 2023-10-01 15:24:34 +11:00
Lucas Smith
f7933d8a4d Merge pull request #477 from Hallidayo/button-texts
feat: auth button loading texts
2023-10-01 13:42:19 +11:00
Ollie Halliday
4bd0cfd283 capitalise 2023-09-30 17:00:43 +01:00
Ollie Halliday
86f39f3824 text changes on isSubmitting 2023-09-30 16:50:52 +01:00
Ephraim Atta-Duncan
94216f5219 Merge pull request #474 from adithyaakrishna/fix/scripts 2023-09-29 21:56:13 +00:00
Adithya Krishna
a2e6187dae fix: typo in script
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
2023-09-30 01:42:09 +05:30
pit
c2cda0f06e feat: update user functionality 2023-09-29 17:26:37 +01:00
pit
f1bc772985 chore: improve the ui 2023-09-29 17:12:02 +01:00
Lucas Smith
15e3926ce4 Merge pull request #463 from documenso/docs/minor-readme-updatess
docs: readme updates.
2023-09-30 00:48:38 +10:00
Lucas Smith
69738d7ed3 Merge branch 'feat/refresh' into docs/minor-readme-updatess 2023-09-30 00:48:30 +10:00
Mythie
649620c1c9 fix: update compose scripts 2023-09-30 00:47:50 +10:00
Mythie
99df006019 fix: further readme updates 2023-09-30 00:43:45 +10:00
Timur Ercan
be40e28f47 Update README.md 2023-09-29 14:42:26 +02:00
Lucas Smith
8899d82e1b Merge pull request #462 from adithyaakrishna/issue#461
fix: sharp corners of signing card
2023-09-29 18:12:00 +10:00
Mythie
0527641a4f fix: dogfood resend transport 2023-09-29 12:17:41 +10:00
Ephraim Atta-Duncan
54e32af1d4 docs: clearer readme? maybe? 2023-09-28 22:48:02 +00:00
Adithya Krishna
b1645ec09a fix: sharp corners of signing card 2023-09-29 02:01:04 +05:30
Timur Ercan
5b9ce55a6d Merge pull request #457 from documenso/feat-early-adopters
chore: sync
2023-09-28 21:29:09 +02:00
Timur Ercan
833584bd4f Merge branch 'feat/refresh' into feat-early-adopters 2023-09-28 21:28:41 +02:00
Timur Ercan
ca52a22bcd chore: sync 2023-09-28 14:59:41 +02:00
Lucas Smith
ba611b9adb Merge pull request #440 from PeterKwesiAnsah/chore/add-empty-recipientlist-message
chore: add empty message
2023-09-28 22:12:21 +10:00
Timur Ercan
e8643850a0 Merge pull request #397 from documenso/feat-early-adopters
feat: early adopters
2023-09-28 13:16:21 +02:00
Timur Ercan
bec7376fe8 Merge branch 'feat/refresh' into feat-early-adopters 2023-09-28 13:16:09 +02:00
Timur Ercan
7363bbc8f7 chore: sync next 2023-09-28 13:15:56 +02:00
Lucas Smith
d0f679e177 Merge pull request #430 from documenso/feat/update-email-templates
feat: update email templates
2023-09-28 20:58:22 +10:00
Lucas Smith
e9769904ab Merge pull request #453 from documenso/fix/443-validation-with-multiple-recipients
fix: add hack for root zod validation with hook form
2023-09-28 20:57:21 +10:00
Timur Ercan
a2746742a7 Merge remote-tracking branch 'origin/feat/refresh' into feat-early-adopters 2023-09-28 12:35:10 +02:00
Timur Ercan
459e3dc45b Merge pull request #400 from documenso/feat/open-early-adopters
feat: add early adopters graph
2023-09-28 12:17:03 +02:00
Timur Ercan
21fedab707 Merge branch 'feat/refresh' into feat/open-early-adopters 2023-09-28 12:16:27 +02:00
PeterKwesiAnsah
323f1974ab chore: added classname and changed typo 2023-09-28 11:13:02 +01:00
Lucas Smith
5bc9d625c2 Merge pull request #455 from documenso/fix/432-signee-doc-version-doesnt-have-sticky-signing-area
fix: resolve issues with signing document stickiness
2023-09-28 17:50:04 +10:00
Mythie
4885cf5154 fix: resolve issues with signing document stickiness 2023-09-28 17:42:01 +10:00
Lucas Smith
2f66eca925 Merge pull request #454 from documenso/fix/446-cancel-cta-does-nothing-when-a-signer-opens-the-document
fix: disable cancel button when there is no window history
2023-09-28 17:15:41 +10:00
Mythie
af042a62cd fix: disable cancel button when there is no window history 2023-09-28 15:45:22 +10:00
Mythie
2bfc2b0c1f fix: add hack for root zod validation with hook form 2023-09-28 15:32:03 +10:00
Lucas Smith
df8bdda718 Merge pull request #450 from documenso/feat/resend-transport
feat: add resend mail transport
2023-09-28 14:07:18 +10:00
David Nguyen
873f99ae86 fix: resolve document title inconsistency (#452) 2023-09-28 13:56:22 +10:00
Lucas Smith
17fe135027 Merge pull request #451 from documenso/fix/445-signer-name-not-persisting
fix: do not overwrite new names or emails for signers
2023-09-28 13:07:26 +10:00
David Nguyen
2eed0ae063 feat: add posthog reverse proxy (#449) 2023-09-28 12:56:53 +10:00
Mythie
f4ae0389d8 fix: do not overwrite new names or emails for signers 2023-09-28 12:35:21 +10:00
Mythie
9bdff9a61f feat: add resend mail transport 2023-09-28 12:27:04 +10:00
PeterKwesiAnsah
f003a2864e chore: add empty message 2023-09-27 13:08:59 +01:00
Timur Ercan
ab26af19b8 Merge branch 'feat/refresh' into chore/team 2023-09-27 13:09:26 +02:00
Timur Ercan
dc512600dc chore: and now his watch has ended 2023-09-27 13:08:19 +02:00
Timur Ercan
cdb71c3a62 chore: greetings 2023-09-27 12:30:11 +02:00
Timur Ercan
39d7b3ca58 Merge branch 'feat/refresh' of https://github.com/documenso/documenso into feat/refresh 2023-09-27 12:19:14 +02:00
Timur Ercan
748c3636d5 chore: sync shop article and add missing and updated assets 2023-09-27 12:15:44 +02:00
David Nguyen
6e2d1fb148 fix: add missing URL to email template 2023-09-27 17:44:29 +10:00
Mythie
7bd847c0d3 chore: add missing migrations 2023-09-27 16:53:48 +10:00
David Nguyen
81f9b2f776 Merge branch 'feat/refresh' into feat/update-email-templates 2023-09-27 15:50:54 +10:00
David Nguyen
334671ef85 feat: add email forgot password action
Updated email template imports
2023-09-27 15:34:16 +10:00
Lucas Smith
a20b1e2f6a Merge pull request #350 from documenso/feat/redirect-signed-document
feat: redirect signed document to completed page
2023-09-27 15:09:07 +10:00
Mythie
572f9d5ad6 chore: styling updates 2023-09-27 14:58:10 +10:00
Mythie
e49c102e8c fix: lint errors 2023-09-27 09:11:56 +10:00
Mythie
2348221b03 fix: faster tooltips 2023-09-27 09:09:53 +10:00
Mythie
a0c327cfcf fix: share og updates 2023-09-27 09:03:53 +10:00
Mythie
ddbeb9e3db fix: twitter images 2023-09-27 08:02:51 +10:00
Mythie
e8205c1390 fix: better share links 2023-09-27 07:52:24 +10:00
Timur Ercan
fbb53fc8c3 chore: update mania shirt res 2023-09-26 22:06:41 +02:00
Timur Ercan
d7fed5a5dc feat: shop Article 2023-09-26 21:49:04 +02:00
Timur Ercan
3285881586 chore: typos 2023-09-26 11:39:30 +02:00
Timur Ercan
3ff61607a2 Merge pull request #370 from documenso/feat/mania
feat: malfunction mania blog post
2023-09-26 11:24:24 +02:00
Timur Ercan
2a124b03e9 Merge branch 'feat/refresh' into feat/mania 2023-09-26 11:24:13 +02:00
Timur Ercan
e1aa23bc55 chore: fix typo 2023-09-26 11:23:39 +02:00
Timur Ercan
818c5c7ba4 chore: fix lightmode logo 2023-09-26 11:19:32 +02:00
Timur Ercan
668011d1c7 Update README.md with M̸͍͚̽͒A̴̯͊͌L̴͖͖͘F̵̗̻́̅U̶̲̅͠N̸͙̰̓C̵̙̮̾T̸̜̙͌Í̷͎̯Ö̵̘̜́N̴̳͊̈ͅ ̶͔́M̸̡͐̾A̵̞̚N̴̤̏́Ǐ̸̩͂Ă̸͓͝ 2023-09-26 11:12:59 +02:00
Timur Ercan
562fd043a9 chore: typo 2023-09-26 10:31:41 +02:00
Timur Ercan
b4781c011c chore: alt text 2023-09-26 10:27:19 +02:00
Timur Ercan
5c7d3d5503 chore: update date 2023-09-26 10:26:16 +02:00
Timur Ercan
0f2b6c0ebf chore: remove unused image 2023-09-26 10:23:28 +02:00
Timur Ercan
ab5bdfeae4 chore: typo 2023-09-26 10:18:56 +02:00
David Nguyen
e5fa2f4490 feat: update email templates
Add SPM email attachment
2023-09-26 17:48:26 +10:00
Mythie
2d2615447e fix: redirectless authentication 2023-09-26 16:17:01 +10:00
Mythie
46465acd73 chore: quieten dependabot 2023-09-26 16:11:06 +10:00
Lucas Smith
2dea9ec3e7 Merge pull request #423 from documenso/feat/copy-or-tweet
feat: add dropdown to tweet or copy signing link
2023-09-26 16:08:43 +10:00
Mythie
584d5bd8ea fix: update share preview 2023-09-26 15:58:43 +10:00
Mythie
e4b6d42672 fix: styling updates 2023-09-26 15:56:11 +10:00
Timur Ercan
109ad190cf fix: text 2023-09-25 19:13:03 +02:00
Ephraim Atta-Duncan
78498793fa chore: refactor function 2023-09-25 11:21:39 +00:00
Ephraim Atta-Duncan
b2e916378d feat: add dropdown to tweet or copy signing link 2023-09-25 11:15:31 +00:00
Timur Ercan
d950634aab Merge branch 'feat/refresh' into feat/open-early-adopters 2023-09-25 09:28:04 +02:00
Mythie
a52c19355a chore: sign document 2023-09-25 15:57:10 +10:00
Mythie
e67e96333b fix: dark mode for generic mdx content 2023-09-25 11:31:26 +10:00
Lucas Smith
7aa75b0c64 Merge pull request #403 from documenso/feat/single-player-mode
feat: single player mode
2023-09-25 11:25:58 +10:00
Mythie
9b1069f208 fix: remove usage of buffer 2023-09-25 11:24:55 +10:00
Mythie
abe20b8dcf fix: assorted updates 2023-09-25 11:17:59 +10:00
Mythie
58509c54a9 fix: feature flag client endpoint 2023-09-25 10:35:18 +10:00
Mythie
fd545cee0c chore: update env.example 2023-09-25 10:33:38 +10:00
Mythie
1f92bffe7d chore: remove console.log 2023-09-25 10:09:02 +10:00
Timur Ercan
5615627001 Merge pull request #419 from documenso/fix/incorporation
fix: company name
2023-09-24 21:53:10 +02:00
Timur Ercan
78c55875ef fix: company name 2023-09-24 21:52:09 +02:00
Mythie
a3674947b8 fix: single player dark mode and animation updates 2023-09-25 00:18:41 +10:00
Mythie
63cc57b035 fix: improve dark mode background patterns 2023-09-25 00:18:15 +10:00
Mythie
d4bc1eb0d1 fix: cors for feature flags 2023-09-25 00:16:01 +10:00
Mythie
c9f5496acb Merge remote-tracking branch 'origin/feat/refresh' into feat/single-player-mode 2023-09-24 22:18:01 +10:00
Mythie
99481b6144 feat: darker dark theme 2023-09-24 14:45:50 +10:00
Mythie
cee147bc9a fix: normalize recipients 2023-09-24 11:46:36 +10:00
Lucas Smith
3a825391b9 Merge pull request #399 from captain-Akshay/feat/handle_click
fix: cancel button handler
2023-09-23 22:19:57 +10:00
Lucas Smith
bb347e4614 Merge pull request #326 from documenso/feat/completed-share-link
feat: signing completed sharing link
2023-09-23 22:18:17 +10:00
Ephraim Atta-Duncan
d0fad4775a feat: add extra info for the early adopters 2023-09-23 12:02:37 +00:00
Lucas Smith
68d624ac78 Merge branch 'feat/refresh' into feat/completed-share-link 2023-09-23 21:07:31 +10:00
David Nguyen
8012d665ae fix: firefox signing fields 2023-09-23 13:25:39 +10:00
Timur Ercan
0732aa317d chore: rename community plan to early adopters 2023-09-22 18:54:25 +02:00
Timur Ercan
fde53e355f chore: staging 2023-09-22 18:44:34 +02:00
Timur Ercan
8e0a10298e Merge branch 'feat/refresh' into feat/mania 2023-09-22 18:33:16 +02:00
Ephraim Atta-Duncan
eef63c9adc refactor: metrics into reusable component 2023-09-22 14:08:25 +00:00
Lucas Smith
1e5ecd79c2 Merge pull request #354 from documenso/feat/table-empty-state
feat: add empty document state
2023-09-22 23:36:42 +10:00
Lucas Smith
58f10268e2 Merge pull request #359 from documenso/feat/send-email
feat: send email when recipient is done signing and every recipient is done signing
2023-09-22 23:29:35 +10:00
Lucas Smith
43ce76d928 fix: remove unused import 2023-09-22 23:29:14 +10:00
Ephraim Atta-Duncan
c3d52c68e7 feat: add early adopters graph 2023-09-22 13:27:10 +00:00
Lucas Smith
201ba65e1c fix: remove unused import 2023-09-22 23:23:55 +10:00
Lucas Smith
0d130b17c8 fix: minor updates 2023-09-22 23:22:48 +10:00
Lucas Smith
2c90f767fd Merge branch 'feat/refresh' into feat/send-email 2023-09-22 23:19:43 +10:00
Lucas Smith
946b2fe129 fix: use named export 2023-09-22 23:15:30 +10:00
Lucas Smith
2a2dbb65c6 Merge branch 'feat/refresh' into feat/table-empty-state 2023-09-22 23:13:51 +10:00
Lucas Smith
ef2300a600 Merge pull request #343 from adithyaakrishna/feat/404
feat: added custom `not-found` or 404 pages
2023-09-22 23:11:34 +10:00
Lucas Smith
eea99ac871 Merge pull request #391 from documenso/feat/custom-emails
feat: send custom emails
2023-09-22 22:53:09 +10:00
Mythie
f4c7799537 fix: reverse meta relation and tidy code 2023-09-22 12:42:06 +00:00
David Nguyen
764c6b88c5 feat: update success page text 2023-09-22 16:35:49 +10:00
David Nguyen
989d7a351f feat: add uninserted field validation 2023-09-22 16:25:09 +10:00
Lucas Smith
78325d9b39 Merge branch 'feat/refresh' into feat/404 2023-09-22 15:01:49 +10:00
captain-Akshay
679fb80f9a fix: cancel button handler 2023-09-22 10:31:42 +05:30
David Nguyen
dc49277bf9 feat: add uninserted field validation 2023-09-22 12:27:39 +10:00
pit
07bf780c3e feat: build individual user page 2023-09-21 15:10:20 +01:00
Timur Ercan
190ae18edc chore: grammerly 2023-09-21 15:09:20 +02:00
Timur Ercan
82ffbeeb21 chore: links 2023-09-21 15:01:02 +02:00
Timur Ercan
9affd7b7fa Merge branch 'feat/refresh' into feat-early-adopters 2023-09-21 14:54:45 +02:00
Timur Ercan
897ba629df feat: early adopter article 2023-09-21 14:53:48 +02:00
Lucas Smith
b3f26055d9 Merge pull request #395 from nsylke/nsylke-patch-10
fix: remove disallow property of _next from robots
2023-09-21 22:36:30 +10:00
pit
775de16d0a feat: admin ui for managing instance 2023-09-21 12:43:36 +01:00
Mythie
1b276a0469 fix: support optimise imports 2023-09-21 21:34:24 +10:00
Mythie
17fbf2673c Merge remote-tracking branch 'origin/feat/refresh' into feat/completed-share-link 2023-09-21 18:55:52 +10:00
Mythie
cdc50ec876 fix: resolve issues with open graph asset loading 2023-09-21 05:37:04 +00:00
nsylke
181af24b78 fix: remove disallow property of _next from robots 2023-09-20 20:46:23 -05:00
Mythie
4b13a42731 fix: tidy code and update endpoints 2023-09-21 00:51:02 +00:00
Ephraim Atta-Duncan
e330e90688 fix: document meta relation with document 2023-09-20 12:54:24 +00:00
Ephraim Atta-Duncan
f2d3c51651 fix: avoid creating document meta with empty strings 2023-09-20 12:38:39 +00:00
Ephraim Atta-Duncan
c9c111cdf2 fix: persist newline in emails 2023-09-20 12:19:52 +00:00
Lucas Smith
c247295131 Merge pull request #388 from captain-Akshay/feat/theme
feat: added a better theme change ability for user
2023-09-20 21:45:45 +10:00
Ephraim Atta-Duncan
d417255910 feat: replace template variables with values
Co-authored-by: Mythie <me@lucasjamessmith.me>
2023-09-20 11:17:26 +00:00
Ephraim Atta-Duncan
677a15327b feat: send custom email message 2023-09-20 09:59:42 +00:00
Ephraim Atta-Duncan
d5238939ad feat: persist document metadata in database for a specific user 2023-09-20 09:51:04 +00:00
Ephraim Atta-Duncan
6860726e83 feat: send custom email subjects 2023-09-20 09:06:28 +00:00
Ephraim Atta-Duncan
a55197fb2d feat: add prisma schema for document meta 2023-09-20 08:57:50 +00:00
David Nguyen
7eed5c7c96 feat: utilise transport layer 2023-09-20 15:55:25 +10:00
David Nguyen
1c629af651 fix: timeout issues 2023-09-20 15:33:01 +10:00
David Nguyen
4b8aa3298b feat: add single player mode 2023-09-20 13:48:30 +10:00
Lucas Smith
bcb163693a Merge branch 'feat/refresh' into feat/completed-share-link 2023-09-20 12:42:30 +10:00
Lucas Smith
e6e8de62c8 Merge pull request #306 from adithyaakrishna/feat/reveal-password
feat: added feature to show/hide password
2023-09-20 12:38:09 +10:00
Mythie
71c7a6ee8c chore: add visibility toggle to reset password 2023-09-20 02:32:06 +00:00
Mythie
ecc8e59c8c fix: update colors 2023-09-20 02:18:35 +00:00
Lucas Smith
d0f027c4ea Merge branch 'feat/refresh' into feat/reveal-password 2023-09-20 12:13:31 +10:00
Lucas Smith
2c667f785c Merge pull request #385 from documenso/feat/reset-password
feat: reset password
2023-09-20 12:12:57 +10:00
Lucas Smith
1adf7e183e Merge branch 'feat/refresh' into feat/reveal-password 2023-09-20 12:03:24 +10:00
captain-Akshay
7771d7acbe feat: added the icon for theme 2023-09-20 06:56:40 +05:30
Lucas Smith
58580c7fac Merge pull request #386 from documenso/blog/selfhosting-blog-post
feat: add deploying documenso with vercel, supabase and resend
2023-09-20 09:41:41 +10:00
captain-Akshay
4cd56fa98c feat: removed unecessary code to the file and made few UI changes 2023-09-19 19:45:21 +05:30
Lucas Smith
68020006b4 Merge branch 'feat/refresh' into feat/reset-password 2023-09-20 00:03:46 +10:00
Mythie
70cb65d266 fix: update token validity check 2023-09-19 13:59:19 +00:00
Mythie
cef8cad14c fix: update reset token query 2023-09-19 13:57:11 +00:00
Mythie
def8f45f8b fix: update email template 2023-09-19 13:49:01 +00:00
Mythie
ca325cc90b fix: add layout and minor updates 2023-09-19 13:34:54 +00:00
captain-Akshay
a1ce6f696a feat: added a better theme change ability for user 2023-09-19 13:38:37 +05:30
David Nguyen
4d485940ea fix: stripe customer fetch logic 2023-09-19 15:30:58 +10:00
David Nguyen
cbe118b74f fix: merge issues 2023-09-19 15:14:47 +10:00
David Nguyen
de9116e9b2 Merge branch 'feat/refresh' into feat/stripe-free-tier 2023-09-19 15:12:40 +10:00
Mythie
09c7f9dde8 chore: update devcontainer 2023-09-19 15:10:03 +10:00
Lucas Smith
0060b9da8c Merge branch 'feat/refresh' into feat/reset-password 2023-09-19 13:53:38 +10:00
Lucas Smith
bad88a2a83 Merge pull request #387 from nsylke/nsylke-patch-9
feat: security headers
2023-09-19 13:51:57 +10:00
Lucas Smith
96a79b8879 Merge branch 'feat/refresh' into nsylke-patch-9 2023-09-19 13:41:18 +10:00
Mythie
60ef9df721 chore: update ci 2023-09-19 13:34:38 +10:00
Lucas Smith
2d8ca8fea0 Merge pull request #374 from documenso/feat/vercel-build-script
feat: vercel build script
2023-09-19 13:11:49 +10:00
Mythie
b411db40da chore: tidy unused code 2023-09-19 02:40:58 +00:00
David Nguyen
1be0b9e01f feat: add vercel build script 2023-09-19 01:54:20 +00:00
nsylke
d41ca8e0e6 feat: security headers 2023-09-18 20:13:46 -05:00
Timur Ercan
eaa3e0a303 Merge branch 'feat/refresh' into feat/mania 2023-09-18 20:15:50 +02:00
Timur Ercan
a283c88d7f chore: update malfunction mania image 2023-09-18 20:11:27 +02:00
Ephraim Atta-Duncan
d4659eee07 feat: add deploying documenso with vercel, supabase and resend 2023-09-18 17:58:01 +00:00
Ephraim Atta-Duncan
b93e3c0b52 feat: add invalid reset token page 2023-09-18 15:13:19 +00:00
Ephraim Atta-Duncan
079963cde8 feat: better error handling and better toast messages 2023-09-18 15:09:41 +00:00
Ephraim Atta-Duncan
45f447c796 feat: better error handling in forgotPassword trpc router 2023-09-18 14:41:24 +00:00
Ephraim Atta-Duncan
2327b15e0d fix: width reducing with screen size 2023-09-18 14:39:42 +00:00
Ephraim Atta-Duncan
166cbc150f feat: send email to user on successful password reset 2023-09-18 14:31:04 +00:00
Ephraim Atta-Duncan
f561ef3cda feat: add reset functionality 2023-09-18 14:03:33 +00:00
David Nguyen
027a588604 feat: wip 2023-09-18 22:47:46 +10:00
David Nguyen
773566f193 feat: add free tier Stripe subscription 2023-09-18 22:33:07 +10:00
Ephraim Atta-Duncan
29bd4cb9c3 feat: send forgot password email 2023-09-18 12:14:55 +00:00
Ephraim Atta-Duncan
1237944b71 chore: rename email templates export 2023-09-18 11:51:43 +00:00
Ephraim Atta-Duncan
b331e3c780 feat: add reset password email template 2023-09-18 11:49:37 +00:00
Ephraim Atta-Duncan
7f641e3e73 feat: add forgot password template 2023-09-18 11:38:02 +00:00
Ephraim Atta-Duncan
b84f0548d2 feat: create a password reset token 2023-09-18 11:15:29 +00:00
Ephraim Atta-Duncan
0f92534f00 chore: remove unused error toast 2023-09-18 10:34:15 +00:00
Ephraim Atta-Duncan
7a489f241a feat: add reset password page 2023-09-18 10:31:33 +00:00
Ephraim Atta-Duncan
f88e529111 feat: add forgot passoword page 2023-09-18 10:18:33 +00:00
Ephraim Atta-Duncan
47d55a5eab feat: add password reset token to schema 2023-09-18 06:47:03 +00:00
Ephraim Atta-Duncan
9dcab76cd5 feat: use description of each blog post in og image (#380) 2023-09-18 11:37:17 +10:00
Ephraim Atta-Duncan
c2a9647c90 Merge branch 'feat/refresh' into feat/redirect-signed-document 2023-09-17 14:52:44 +00:00
Ephraim Atta-Duncan
02424596db fix: update for code review 2023-09-17 14:45:22 +00:00
Ephraim Atta-Duncan
776324c875 fix: fitler only unsigned documents 2023-09-17 14:38:39 +00:00
Ephraim Atta-Duncan
6f4c280583 chore: match file name and method name 2023-09-17 14:31:44 +00:00
Lucas Smith
dfebdfccda Merge pull request #357 from documenso/feat/universal-upload
feat: universal upload
2023-09-16 15:35:30 +10:00
Timur Ercan
5809109c05 chore: grammerly, finetuned bounties 2023-09-14 15:43:17 +02:00
Timur Ercan
a6400eb6c9 Merge branch 'feat/refresh' into feat/mania 2023-09-14 15:29:55 +02:00
flō
39958ed22c Fix typo 2023-09-14 14:57:11 +02:00
Lucas Smith
c3d9cac43f Merge pull request #373 from documenso/chore/readme
chore: update readme to main version
2023-09-14 20:35:21 +10:00
Lucas Smith
74355244a4 Merge pull request #372 from documenso/chore/blogposts
chore: moved rewrite article from next repo
2023-09-14 20:34:55 +10:00
flō
7c4ba1b1ea Fix typo 2023-09-14 11:38:42 +02:00
flō
f588897531 Fix punctuation for consistency 2023-09-14 11:33:11 +02:00
flō
5629e08f83 Add keywords
added keywords in description for SEO optimizations
2023-09-14 11:06:48 +02:00
flō
37394c054c Fix typo
Fix typo and minor edits for consistency
2023-09-14 11:04:10 +02:00
Mythie
8be52e2fa3 fix: final reference to created column 2023-09-14 14:50:17 +10:00
Mythie
0d702e9189 fix: remove further references to created column 2023-09-14 13:37:38 +10:00
Mythie
425db8fc1f fix: remove references to created column 2023-09-14 13:32:16 +10:00
Mythie
2356f58e7b fix: implement feedback 2023-09-14 13:21:03 +10:00
Mythie
6c12ed4afc fix: update migration for timestamp columns 2023-09-14 13:07:55 +10:00
Lucas Smith
d76ee7f33c Merge branch 'feat/refresh' into feat/universal-upload 2023-09-14 12:53:58 +10:00
Mythie
f8534b2c3d fix: add dashboard header border on scroll 2023-09-14 12:51:59 +10:00
Mythie
9014f01276 feat: universal upload
Implementation of a universal upload allowing for multiple storage backends
starting with `database` and `s3`.

Allows clients to put and retrieve files from either client or server using
a blend of client and server actions.
2023-09-14 12:47:47 +10:00
Timur Ercan
71818c0f1f chore: update readme to main version 2023-09-13 14:57:22 +02:00
Timur Ercan
974dc74073 chore: moved rewrite article from next repo 2023-09-13 14:53:27 +02:00
Timur Ercan
b255eb21e5 Merge pull request #369 from documenso/fix/building-documenso-description
fix: update building documenso article description
2023-09-13 14:45:24 +02:00
Timur Ercan
9a58178ea5 Merge branch 'feat/refresh' into fix/building-documenso-description 2023-09-13 14:42:41 +02:00
Timur Ercan
3c36eedfba chore: phrasing 2023-09-13 14:42:27 +02:00
Timur Ercan
46dfaa70a3 Update apps/marketing/content/blog/building-documenso-pt1.mdx
Co-authored-by: Adithya Krishna  <aadithya794@gmail.com>
2023-09-13 14:39:01 +02:00
Lucas Smith
61da354a48 Merge pull request #361 from documenso/feat/admin-ui-metrics
feat: admin ui for metrics
2023-09-13 21:55:09 +10:00
Lucas Smith
fbb332fb35 Merge branch 'feat/refresh' into feat/admin-ui-metrics 2023-09-13 21:54:33 +10:00
Lucas Smith
7e1cce9155 Merge pull request #365 from documenso/feat/avatar-fallback
feat: add avatar email fallback
2023-09-13 21:51:42 +10:00
Lucas Smith
ed4cbe9fa6 Merge branch 'feat/refresh' into feat/universal-upload 2023-09-12 20:51:31 +10:00
Mythie
599e857a1e fix: add removed layout guard 2023-09-12 17:53:38 +10:00
Lucas Smith
581f08c59b fix: update layout and wording 2023-09-12 07:25:44 +00:00
David Nguyen
24a2e9e6d4 feat: update document table layout (#371)
* feat: update document table layout

- Removed dashboard page
- Removed redundant ID column
- Moved date to first column
- Added estimated locales for SSR dates
2023-09-12 14:29:27 +10:00
David Nguyen
e8796a7d86 refactor: organise recipient utils 2023-09-12 12:33:04 +10:00
Mythie
db3f75c42f fix: data table links for recipients 2023-09-12 10:38:23 +10:00
Timur Ercan
b7c0df67b1 feat: malfunction mania, first draft 2023-09-11 18:20:17 +02:00
Timur Ercan
e8b5b3b24a fix: update building documenso article description 2023-09-11 15:22:09 +02:00
Catalin Pit
00574325b9 chore: implemented feedback 2023-09-11 13:43:17 +03:00
Catalin Pit
99706e0ed6 chore: fix version in nextjs config 2023-09-11 11:34:10 +03:00
Catalin Pit
326743d8a1 chore: added app version 2023-09-11 10:59:50 +03:00
David Nguyen
3f67b0f27e Merge pull request #292 from documenso/feat/blog-post-next
fix: typo in blog post
2023-09-11 17:09:31 +10:00
flō
24036b0f24 fix typo 2023-09-11 17:03:14 +10:00
David Nguyen
fbf32404a6 feat: add avatar email fallback 2023-09-11 16:58:41 +10:00
Lucas Smith
975d52a07e Merge pull request #362 from documenso/fix/hide-user-selection
fix: hide popover when user selects a recipient
2023-09-11 12:27:50 +10:00
Ephraim Atta-Duncan
f8a193c0f8 refactor: replace whole implementation with a state 2023-09-09 10:56:45 +00:00
Ephraim Atta-Duncan
9186cb4d7b fix: hide popover when user selects a recipients 2023-09-09 10:42:03 +00:00
Lucas Smith
898f5a629c Merge branch 'feat/refresh' into feat/admin-ui-metrics 2023-09-09 15:49:56 +10:00
Mythie
933076fa3f fix: update devcontainer 2023-09-09 15:49:40 +10:00
Lucas Smith
27edcebef6 Merge branch 'feat/refresh' into feat/admin-ui-metrics 2023-09-09 15:44:34 +10:00
Mythie
abc91f7eac fix: update devcontainer 2023-09-09 15:44:10 +10:00
Lucas Smith
5862af3034 Merge branch 'feat/refresh' into feat/admin-ui-metrics 2023-09-09 15:16:03 +10:00
Mythie
35acf05997 feat: add devcontainer 2023-09-09 04:38:37 +00:00
Lucas Smith
2bad1b9f55 fix: tidy messaging 2023-09-09 03:45:15 +00:00
Lucas Smith
73b0dc315e fix: use ts-pattern 2023-09-09 03:31:17 +00:00
Catalin Pit
5969f148c8 chore: changed the cards titles 2023-09-08 14:51:55 +03:00
Catalin Pit
660f5894a6 chore: feedback improvements 2023-09-08 12:56:44 +03:00
Catalin Pit
77058220a8 chore: rename files 2023-09-08 12:42:14 +03:00
Catalin Pit
6cdba45396 chore: implemented feedback 2023-09-08 12:39:13 +03:00
Catalin Pit
67571158e8 feat: add the admin page 2023-09-08 11:28:50 +03:00
Catalin Pit
171a5ba4ee feat: creating the admin ui for metrics 2023-09-08 09:16:31 +03:00
Ephraim Atta-Duncan
525ff21563 feat: avoid sending pending email to document with 1 recipients 2023-09-07 20:52:18 +00:00
Ephraim Atta-Duncan
863e53a2d5 refactor: pass document id as arguments 2023-09-07 20:38:18 +00:00
Ephraim Atta-Duncan
da2033692c feat: send email when all recipients have signed 2023-09-07 20:14:04 +00:00
Ephraim Atta-Duncan
dbbe17a0a8 feat: send email when recipient is done signing 2023-09-07 19:58:48 +00:00
Mythie
a2ef9468ae feat: separate document data from document 2023-09-07 19:27:21 +10:00
Ephraim Atta-Duncan
0c145fab0b chore: fix eslint errors 2023-09-06 12:01:30 +00:00
Ephraim Atta-Duncan
f6e49e3f21 chore: remove code from different branch 2023-09-06 12:00:23 +00:00
Ephraim Atta-Duncan
1f027d75d3 chore: fix eslint errors 2023-09-06 11:55:02 +00:00
Ephraim Atta-Duncan
1ba7767f8e chore: correct types on component 2023-09-06 11:52:15 +00:00
Ephraim Atta-Duncan
8220b2f086 feat: add empty state for different status 2023-09-06 11:47:58 +00:00
Ephraim Atta-Duncan
a74374e39f feat: add initial empty state for no results 2023-09-06 11:11:13 +00:00
Lucas Smith
ff957a2f82 Merge pull request #353 from documenso/feat/disable-sign
feat: disable signing and editing for completed documents
2023-09-06 20:53:23 +10:00
Ephraim Atta-Duncan
6640f0496a feat: disable signing and editing for completed documents 2023-09-06 10:40:45 +00:00
Ephraim Atta-Duncan
e47ab838c5 chore: remove undefined check 2023-09-06 07:37:03 +00:00
Ephraim Atta-Duncan
551918ab9b feat: redirect signed document to completed page 2023-09-05 13:53:18 +00:00
Ephraim Atta-Duncan
739f3763dd feat: update share page to match latest changes 2023-09-05 11:40:42 +00:00
Ephraim Atta-Duncan
0cdd980a4b feat: move opengraph-image to next.js 13 implementation 2023-09-05 11:37:21 +00:00
Ephraim Atta-Duncan
b43ddcbea2 refactor: redirect using useRouter 2023-09-05 09:29:47 +00:00
Ephraim Atta-Duncan
75feaefbf2 chore: remove unused files 2023-09-05 09:27:04 +00:00
Lucas Smith
de3ebe16ee Merge pull request #349 from documenso/feat/marketing-mobile-nav
feat: update marketing mobile nav
2023-09-05 18:20:53 +10:00
David Nguyen
84a2d3baf6 feat: update marketing mobile menu 2023-09-05 18:08:29 +10:00
Lucas Smith
74180defd1 Merge pull request #339 from G3root/feat-api-error
feat: add alert banner for errors in sigin page
2023-09-05 15:36:55 +10:00
Lucas Smith
aeeaaf0d8d Merge pull request #340 from G3root/fix-username-updateable
fix: user name not updatable
2023-09-05 15:33:19 +10:00
Lucas Smith
2b84293c4e Merge pull request #341 from documenso/feat/add-email-field
feat: add email field to document sign page
2023-09-05 13:25:29 +10:00
Lucas Smith
b38ef6c0a7 Merge pull request #346 from documenso/chore/remove-console-log-warn
chore: removed console logs and warn
2023-09-05 13:23:57 +10:00
Mythie
d524ea77ab fix: update styling 2023-09-05 13:15:45 +10:00
Mythie
17af4d25bd fix: actually make timeouts clear 2023-09-05 11:33:49 +10:00
Mythie
6e095921e6 fix: tidy up code 2023-09-05 11:29:23 +10:00
nafees nazik
150c42b246 fix: value 2023-09-04 22:24:42 +05:30
Catalin Pit
aecf2f32b9 chore: removed one more console.log 2023-09-04 16:41:28 +03:00
Catalin Pit
b23967d777 chore: removed console.logs and warn 2023-09-04 16:08:22 +03:00
Adithya Krishna
2524458b0c chore: updated wording
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
2023-09-03 23:59:02 +05:30
Adithya Krishna
12c45fb882 feat: added 404 page for web app
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
2023-09-03 23:53:07 +05:30
Adithya Krishna
118483b6cc chore: updated 404 page for marketing app
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
2023-09-03 23:52:51 +05:30
Adithya Krishna
fd6350b397 feat: added 404 page for marketing app
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
2023-09-03 23:30:48 +05:30
Ephraim Atta-Duncan
b3291c65bc chore: remove console.log 2023-09-02 22:20:57 +00:00
Ephraim Atta-Duncan
4b849e286c feat: add missing email field to document sign page 2023-09-02 22:08:19 +00:00
nafees nazik
7bcc26a987 fix: user name not updatable 2023-09-02 12:11:07 +05:30
nafees nazik
692722d32e revert: fix: component style 2023-09-02 11:55:44 +05:30
Nafees Nazik
e4f06d8e30 Merge branch 'feat/refresh' into feat-api-error 2023-09-02 11:53:18 +05:30
nafees nazik
c799380787 chore: add comments 2023-09-02 11:51:21 +05:30
nafees nazik
5540fcf0d2 fix: use toast 2023-09-02 11:46:12 +05:30
nafees nazik
d9da09c1e7 fix: typo 2023-09-01 16:25:49 +05:30
nafees nazik
fe90aa3b7b feat: add api error 2023-09-01 16:25:27 +05:30
nafees nazik
0c680e0111 fix: component style 2023-09-01 16:25:00 +05:30
Mythie
7bcf5fbd86 feat: store signature on signup 2023-09-01 19:46:44 +10:00
Mythie
7218b950fe feat: store profile signature 2023-09-01 18:43:53 +10:00
Mythie
8d4df7d3dd fix: update og card 2023-08-31 15:36:09 +10:00
Lucas Smith
f1f6e2e40a Merge branch 'feat/refresh' into feat/completed-share-link 2023-08-31 14:20:52 +10:00
Lucas Smith
901013fdc6 Merge pull request #313 from adithyaakrishna/feat/improve-readability
feat: improve readability and rendering of some components
2023-08-31 14:08:52 +10:00
Lucas Smith
5c9017f3cd Merge branch 'feat/refresh' into feat/improve-readability 2023-08-31 14:06:43 +10:00
Mythie
34e962cc48 fix: minor updates 2023-08-31 14:06:19 +10:00
Lucas Smith
bf9254597a Merge pull request #321 from PeterKwesiAnsah/feat/Add-error-message-to-signature-pad
feat: add error message to signature pad
2023-08-31 13:59:41 +10:00
Mythie
b5efa0d3ea fix: fix eslint warnings 2023-08-31 13:33:13 +10:00
Lucas Smith
a2bdb46076 Merge pull request #333 from documenso/fix/redirect-signin-to-dashboard
fix: redirect signin page to dashboard when logged in
2023-08-31 13:14:52 +10:00
Lucas Smith
ed150d9574 Merge branch 'feat/refresh' into fix/redirect-signin-to-dashboard 2023-08-31 13:14:07 +10:00
Mythie
e756a21fda fix: retain redirect to documents rather than dashboard 2023-08-31 13:12:50 +10:00
Lucas Smith
13084049da Merge pull request #334 from documenso/feat/redirect-on-send
feat: redirect to dashboard when document is sent
2023-08-31 13:09:55 +10:00
Lucas Smith
055e723777 Merge pull request #335 from adithyaakrishna/chore/remove-cl
chore: removed unnecessary `console.log`
2023-08-31 13:09:03 +10:00
Lucas Smith
419318c151 Merge pull request #329 from documenso/feat/blog-og-image
feat: add blog og image
2023-08-31 13:04:15 +10:00
Mythie
7722e63e1b fix: tidying broke generation 2023-08-31 12:08:53 +10:00
Adithya Krishna
40274021ba Merge branch 'feat/refresh' into feat/reveal-password 2023-08-30 20:34:32 +05:30
Adithya Krishna
8529ac3ffe Merge branch 'feat/refresh' into feat/improve-readability 2023-08-30 20:34:08 +05:30
Adithya Krishna
7ec8e762b0 chore: removed console logs
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-30 18:49:13 +05:30
Ephraim Atta-Duncan
2acada6dc7 chore: unused console logs 2023-08-30 13:09:37 +00:00
Ephraim Atta-Duncan
d4d76dce03 feat: redirect to dashboard when document is sent 2023-08-30 12:31:33 +00:00
Ephraim Atta-Duncan
3832ce2c80 fix: redirect root direcotory to dashboard 2023-08-30 11:32:55 +00:00
Ephraim Atta-Duncan
fd36e39a38 fix: redirect signin page to dashboard when logged in 2023-08-30 11:32:08 +00:00
Mythie
14fd0eb906 fix: tidy code and expect jsx errors 2023-08-30 18:41:37 +10:00
Lucas Smith
af6c62d0bf Merge branch 'feat/refresh' into feat/blog-og-image 2023-08-30 18:28:21 +10:00
Mythie
8d7d6a19e7 fix: update import for feature-flag helpers 2023-08-30 18:06:41 +10:00
Mythie
463dc48ea6 fix: extract feature-flag zod schema to separate file 2023-08-30 17:31:23 +10:00
Lucas Smith
d8f6a25059 Merge pull request #332 from documenso/feat/billing-page
feat: make billing page functional
2023-08-30 16:41:39 +10:00
Mythie
93962625ed fix: further stash conflicts 2023-08-30 16:39:35 +10:00
Mythie
249211bd4f fix: add items from stash 2023-08-30 16:36:22 +10:00
Mythie
bfe0d50661 feat: make billing page functional 2023-08-30 16:15:13 +10:00
Mythie
5d4a07bcc5 fix: center align heading 2023-08-30 15:41:29 +10:00
Mythie
d28bb5de99 fix: use nextjs opengraph-image component 2023-08-30 15:32:44 +10:00
Lucas Smith
83a83164d4 Merge pull request #330 from documenso/feat/profile-password-form
feat: avoid user from updating password with the same password
2023-08-30 14:32:21 +10:00
Mythie
d71e43c5d6 fix: minor tidying 2023-08-30 14:01:30 +10:00
Ephraim Atta-Duncan
ed6fa4dc2a feat: avoid updating password with existing password 2023-08-30 03:26:24 +00:00
Ephraim Atta-Duncan
4f3970c361 feat: prevent a user from updating password with the same password 2023-08-30 03:22:47 +00:00
Ephraim Atta-Duncan
40767430d9 feat: reset password from on submit 2023-08-30 03:09:40 +00:00
Ephraim Atta-Duncan
1edfe9548d feat: add og image to blog posts 2023-08-30 02:50:02 +00:00
Lucas Smith
fead48c2f0 Merge pull request #314 from adithyaakrishna/fix/whitespace
fix: removed unnecessary whitespace before className
2023-08-30 12:36:58 +10:00
Mythie
0abd3da7fd fix: update eslint rules 2023-08-30 12:35:43 +10:00
Ephraim Atta-Duncan
2f78922421 feat: add blog og image 2023-08-30 02:33:22 +00:00
Lucas Smith
3df0f61947 Merge branch 'feat/refresh' into fix/whitespace 2023-08-30 12:02:01 +10:00
Lucas Smith
8e42dcb7ee Merge pull request #323 from documenso/feat/promise-safety
feat: promise safety
2023-08-30 11:32:32 +10:00
Lucas Smith
1888ee97e6 Merge pull request #296 from documenso/feat/inbox
feat: add inbox
2023-08-30 10:27:32 +10:00
Lucas Smith
068aef665d Merge pull request #328 from nsylke/nsylke-patch-8
chore: change root package.json name
2023-08-30 10:10:42 +10:00
nsylke
2772fc1678 chore: change root package.json name 2023-08-29 16:19:56 -05:00
Ephraim Atta-Duncan
66dfdc5ad0 feat: redirect share page to marketing page after 3 seconds 2023-08-29 19:42:37 +00:00
Ephraim Atta-Duncan
b45978374b feat: generate metatags for share page with og image 2023-08-29 19:08:54 +00:00
Ephraim Atta-Duncan
81c3e701e2 feat: display signature text from params 2023-08-29 18:46:15 +00:00
Ephraim Atta-Duncan
874d919a6a feat: create sharing id for each recipient 2023-08-29 18:23:52 +00:00
Ephraim Atta-Duncan
e8559cecd5 feat: add initial og image for share link 2023-08-29 14:39:49 +00:00
Mythie
8c4120f0a2 fix: remove further unused code 2023-08-29 18:12:46 +10:00
Mythie
9f93af6134 fix: remove unused code 2023-08-29 17:26:19 +10:00
Adithya Krishna
3cbc722b94 Merge branch 'feat/refresh' into feat/reveal-password 2023-08-29 12:43:46 +05:30
Adithya Krishna
3440c47c3c Merge branch 'feat/refresh' into feat/improve-readability 2023-08-29 12:43:30 +05:30
Mythie
68a5a9da1e feat: add data table actions 2023-08-29 14:33:07 +10:00
Mythie
1f8d5e45e1 feat: onepage inbox 2023-08-29 14:33:05 +10:00
David Nguyen
8fd9730e2b feat: add inbox 2023-08-29 14:31:13 +10:00
Lucas Smith
04f6df6839 Merge pull request #304 from G3root/fix-overscroll
fix: tab overflow on smaller viewport and tab scroll ux
2023-08-29 13:26:26 +10:00
Mythie
ca40e983e3 feat: promise safety with eslint 2023-08-29 13:01:19 +10:00
PeterKwesiAnsah
9257454a96 feat: add error message to signature pad 2023-08-28 14:11:53 +01:00
Lucas Smith
ba054ae915 Merge pull request #319 from documenso/chore/reduce-refetch-time
chore: reduce open page caching time to 1 hour
2023-08-28 22:58:05 +10:00
Ephraim Atta-Duncan
1d1c6e5a55 chore: reduce open page caching time to 1 hour 2023-08-28 09:43:39 +00:00
Adithya Krishna
8844143ff5 chore: fixed conflicts
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 13:02:33 +05:30
Adithya Krishna
c161a8109b fix: removed passHref and updated card
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:58:30 +05:30
Adithya Krishna
e340c4ed6f fix: reverted line change
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:54:55 +05:30
Adithya Krishna
b5f96ee2fc chore: made requested changes - v2
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:53:51 +05:30
Adithya Krishna
3c1790ba83 chore: made requested changes
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:45:23 +05:30
Adithya Krishna
f41c78e8e3 feat: updated rendeing of items using map
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:45:23 +05:30
Adithya Krishna
b8b8b4dbad chore: updated footer component
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:45:22 +05:30
Adithya Krishna
d195dc1a46 chore: updated signing fields
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:45:22 +05:30
Adithya Krishna
3ac29d8da3 chore: updated dashboard page
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:45:22 +05:30
Adithya Krishna
2418612507 chore: updated documents page
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:45:22 +05:30
Adithya Krishna
e8336ae9b4 chore: removed eslint-plugin-import
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:34:29 +05:30
Adithya Krishna
aad52a3e2e fix: updated eslint config
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:34:29 +05:30
Adithya Krishna
829122c486 feat: added eslint plugin dependencies
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:34:29 +05:30
Adithya Krishna
090752c539 feat: added new eslint rules
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:34:29 +05:30
Adithya Krishna
fad6414995 fix: duplicate import
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:34:29 +05:30
Adithya Krishna
c817c67a1c fix: removed more unnecessary whitespace
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:34:29 +05:30
Adithya Krishna
c7001e62f3 fix: removed unnecessary whitespace
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-28 12:34:29 +05:30
Lucas Smith
bf71d2a14e Merge pull request #305 from G3root/responsive-signing-card
fix: make signing form card responsive
2023-08-28 13:07:46 +10:00
Lucas Smith
163911255e Merge pull request #308 from adithyaakrishna/feat/pr-validate
feat: pr title validator workflow
2023-08-28 12:21:36 +10:00
Lucas Smith
24e38a3bbc Merge pull request #309 from nsylke/nsylke-patch-7
feat: set min/max lengths and autocomplete for password
2023-08-28 12:21:08 +10:00
Lucas Smith
dfd714f16a Merge pull request #310 from adithyaakrishna/feat/add-sharp
feat: added sharp package for NextJS13 image optimizations
2023-08-28 12:19:33 +10:00
Mythie
722081f89e fix: dependency ordering 2023-08-28 12:14:15 +10:00
Lucas Smith
f0e1df22b8 Merge pull request #312 from G3root/fix-auth
fix: authentication allowing any password
2023-08-28 12:04:07 +10:00
nafees nazik
615cb263fb fix: authentication 2023-08-27 07:10:41 +05:30
nafees nazik
18faaf49d9 fix: style 2023-08-27 06:26:49 +05:30
Adithya Krishna
650b69ae56 feat: added sharp for image optimizations on nextjs
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-26 21:23:30 +05:30
Adithya Krishna
eb4be963e3 fix: added eol to workflow file
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-26 20:57:02 +05:30
Adithya Krishna
27c27743e3 chore: updated workflow name
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-26 20:57:02 +05:30
Adithya Krishna
92930a2f63 feat: added pr title validator
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-26 20:57:02 +05:30
nsylke
7ad3365b0e feat: add autocomplete for password managers 2023-08-26 10:22:44 -05:00
Adithya Krishna
7de7624477 fix: update icon sizes
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-26 20:52:07 +05:30
Adithya Krishna
7c6b5ac59d fix: updated padding and set patterns
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-26 20:43:54 +05:30
Adithya Krishna
9c45ce61b8 feat: added show password feature
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-26 20:43:54 +05:30
nsylke
f8bf4fea36 feat: set min/max lengths for password 2023-08-26 09:53:58 -05:00
Lucas Smith
10cd8144eb Merge pull request #307 from adithyaakrishna/feat/optimize-images
chore: optimize images
2023-08-26 20:06:48 +10:00
Adithya Krishna
66973a3745 chore: optimized images to save ~8mb
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-26 13:13:30 +05:30
nafees nazik
85677bb792 fix: make signing form card responsive 2023-08-26 08:47:19 +05:30
nafees nazik
7ae99d2038 fix: overflow and scroll ux 2023-08-26 07:22:51 +05:30
Mythie
70a5105783 fix: add missing await on mail send 2023-08-25 18:33:24 +10:00
Mythie
420372ac9e fix: nicer dark mode for stack avatars 2023-08-25 17:52:58 +10:00
Mythie
6b00282a87 chore: support direct urls for prisma 2023-08-25 17:52:24 +10:00
Lucas Smith
dae1001cbb Merge pull request #300 from documenso/feat/update-document-flow
feat: update document flow
2023-08-25 12:11:43 +10:00
David Nguyen
af81d99b2a refactor: remove whitespace 2023-08-25 11:43:41 +10:00
David Nguyen
2751adc463 feat: update document flow
- Fixed z-index when dragging pre-existing fields
- Refactored document flow
- Added button spinner
- Added animation for document flow slider
- Updated drag and drop fields
- Updated document flow so it adjusts to the height of the PDF
- Updated claim plan dialog
2023-08-25 11:43:41 +10:00
Lucas Smith
396ce9f3f3 Merge pull request #295 from nsylke/nsylke-patch-6
fix: use -p cli option for next dev
2023-08-25 11:29:44 +10:00
Lucas Smith
3f4f66d878 Merge pull request #298 from adithyaakrishna/fix/dependabot
fix: dependabot workflow
2023-08-25 11:28:12 +10:00
Adithya Krishna
d6751d7a26 fix: dependabot workflow
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
2023-08-24 05:37:17 +00:00
Mythie
0e32baff0b feat: change document view upon completion 2023-08-24 13:31:50 +10:00
nsylke
f76bf4c2c7 fix: use -p cli option for next dev 2023-08-23 17:56:12 -05:00
Lucas Smith
0d8532ab6d Merge pull request #293 from documenso/feat/refactor-shared-components
refactor: extract common components into UI package
2023-08-23 14:08:23 +10:00
Lucas Smith
490d3d51e1 Merge pull request #290 from nsylke/nsylke-patch-5
feat: create robots.txt and sitemap.xml
2023-08-23 13:56:46 +10:00
David Nguyen
2ab796910e refactor: extract common components into UI package 2023-08-23 11:22:13 +10:00
Mythie
07102588be chore: resolve build errors 2023-08-23 10:57:31 +10:00
Nicholas Sylke
04f9422f24 feat: robots.txt & sitemap.xml 2023-08-21 21:41:19 -05:00
Lucas Smith
05a7f5e178 Merge pull request #289 from adithyaakrishna/fix/codeql
fix: fixed build command in codeql workflow
2023-08-22 12:10:45 +10:00
Adithya Krishna
7bae814f96 fix: fixed build command in codeql workflow
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-22 07:26:26 +05:30
Lucas Smith
ea45e38fa0 Merge pull request #273 from documenso/feat/feature-flag
feat: feature flags
2023-08-22 10:13:51 +10:00
Lucas Smith
6d9a85112f Merge pull request #286 from documenso/feat/blog-post-next
feat: add blog post 'Preview the next Documenso'
2023-08-22 10:07:43 +10:00
Lucas Smith
346efd19db Merge pull request #284 from adithyaakrishna/feat/general-updates
feat: added codeql and dependabot workflows
2023-08-22 10:06:39 +10:00
Adithya Krishna
617143a47f fix: removed ts from codeql
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-21 22:42:45 +05:30
flō
66f067276e Add visual asset for blog post 2023-08-21 17:24:29 +02:00
flō
fc10d0449f Create blog post 2023-08-21 17:23:47 +02:00
Adithya Krishna
083f3e7108 feat: add codeql-analysis
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-21 19:08:47 +05:30
Adithya Krishna
af307a2a49 chore: updated dependabot config
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-21 19:03:53 +05:30
Adithya Krishna
b063758ee5 chore: update readme file with radix-ui
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-21 19:03:26 +05:30
Adithya Krishna
4964b252e3 chore: update readme file
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-21 18:56:48 +05:30
Adithya Krishna
e468f5bbc9 chore: enable job concurrency
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-21 18:55:53 +05:30
Adithya Krishna
c5b7b8a18a feat: add dependabot config
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-21 18:54:59 +05:30
Adithya Krishna
a8a1fbb829 feat: Added Engines to Enforce Node v18.0.0 and above
Signed-off-by: Adithya Krishna <adikrish@redhat.com>
2023-08-21 18:54:44 +05:30
Timur Ercan
3c2a4892e7 Merge pull request #283 from documenso/chore/shop
chore: add shop to footer
2023-08-21 14:18:18 +02:00
Timur Ercan
6d9e84d327 chore: add shop to footer 2023-08-21 14:16:19 +02:00
Timur Ercan
73b4e30c97 Merge pull request #257 from documenso/feat/onepage
Feat/onepage
2023-08-21 13:33:04 +02:00
Lucas Smith
bd01545a70 Merge pull request #271 from premiare/feat/mobileNavigation
feat: Mobile Navigation
2023-08-21 20:01:08 +10:00
Mythie
6d360e581d fix: styling updates 2023-08-21 19:56:18 +10:00
David Nguyen
ba95818da4 feat: update items 2023-08-21 12:17:56 +10:00
David Nguyen
d0720f4c70 feat: update items
Refactored billing flag name

Refactored FeatureFlag type

Disabled session recording by default
2023-08-21 12:17:56 +10:00
David Nguyen
f60cb22f11 feat: feature flags 2023-08-21 12:17:56 +10:00
Lucas Smith
e0cb4314fb Merge pull request #280 from nsylke/nsylke-patch-4
chore: ignore intellij editor settings and some of vscode
2023-08-19 10:53:11 +10:00
Nicholas Sylke
0571137a60 chore: ignore intellij editor settings and some of vscode 2023-08-18 18:41:06 -05:00
Timur Ercan
30aabf50eb Merge pull request #279 from documenso/feat/funding
chore: remove funding rounding
2023-08-18 17:50:51 +02:00
Timur Ercan
8441a5eb98 Merge branch 'feat/refresh' into feat/funding 2023-08-18 17:48:31 +02:00
Timur Ercan
259ab49bc1 chore: remove funding rounding 2023-08-18 17:47:36 +02:00
premiare
2f2d5dfc0b Merge branch 'feat/refresh' into feat/mobileNavigation 2023-08-18 19:57:26 +10:00
premiare
0f27f4261b add PORT number back to package.json 2023-08-18 19:37:07 +10:00
premiare
9b92cad2db move menu links to map, add window-size hook 2023-08-18 19:35:45 +10:00
premiare
ad1ff6159c add reducedMotion check, center menu items 2023-08-18 19:05:46 +10:00
Lucas Smith
f633b17f17 Merge pull request #270 from Ashutosh-Bhadauriya/feat/add-commitlint
feat: add commitlint
2023-08-18 18:38:31 +10:00
Ashutosh-Bhadauriya
8fa16001e6 fix: commitlint 2023-08-18 13:49:46 +05:30
Ashutosh-Bhadauriya
e111234460 feat: add commitlint 2023-08-18 13:26:01 +05:30
Lucas Smith
034072f50e Merge branch 'feat/refresh' into feat/onepage 2023-08-18 12:15:36 +10:00
Lucas Smith
a7664d79fd Merge pull request #260 from documenso/feat/document-authoring
feat: document authoring
2023-08-18 12:10:35 +10:00
Lucas Smith
8ed2393300 Merge branch 'feat/refresh' into feat/document-authoring 2023-08-18 12:07:50 +10:00
Lucas Smith
94cf150ffd Merge pull request #258 from nsylke/nsylke-patch-3
ci: create build workflow
2023-08-18 09:32:44 +10:00
Nicholas Sylke
c571a3d0d9 ci: use built-in cache from setup-node action 2023-08-17 18:17:27 -05:00
Lucas Smith
1c7431b859 Merge pull request #264 from documenso/fix/blog-post-pre-seed
Fix: typo in blog post `pre-seed`
2023-08-18 08:59:21 +10:00
Lucas Smith
2f7d6548ef Merge pull request #259 from documenso/feat/pie-chart-legend
feat: add legend to pie chart
2023-08-18 08:55:49 +10:00
flō
a16525be5e fix typo 2023-08-17 17:20:55 +02:00
flō
21e377d3ff fix typo for consistency 2023-08-17 16:46:42 +02:00
premiare
45d0d3f7e8 extract hamburger to own file 2023-08-18 00:18:25 +10:00
premiare
6e62eb8d81 init mobileNavigation and added documenso symbol 2023-08-18 00:12:13 +10:00
Timur Ercan
e098449af4 Merge pull request #262 from documenso/feat/funding
fix: link
2023-08-17 13:02:38 +02:00
Timur Ercan
47d0030cf0 fix: link 2023-08-17 13:02:21 +02:00
Ephraim Atta-Duncan
b564e5e72f feat: reduce chart radius to add padding 2023-08-17 10:57:36 +00:00
Timur Ercan
e46607c1cb Merge pull request #261 from documenso/feat/funding
Feat/funding
2023-08-17 12:56:04 +02:00
Timur Ercan
77c5db169a fix: format heade 2023-08-17 12:54:40 +02:00
Timur Ercan
0157bf9576 chore: adding open to footer, naming 2023-08-17 12:50:31 +02:00
Timur Ercan
454c2f45bd fix: open page link 2023-08-17 12:46:24 +02:00
Timur Ercan
badb897c06 chore: update date 2023-08-17 12:41:55 +02:00
Timur Ercan
9bb5768598 Merge branch 'feat/refresh' into feat/funding 2023-08-17 12:39:37 +02:00
Timur Ercan
951de8baf5 chore: review updates 2023-08-17 12:37:58 +02:00
Mythie
48ceb1e5c7 feat: document authoring 2023-08-17 19:56:18 +10:00
Ephraim Atta-Duncan
96e8962956 feat: change legend text color to black 2023-08-17 09:44:43 +00:00
Ephraim Atta-Duncan
f3259aedea feat: Add legend to pie chart 2023-08-17 08:24:37 +00:00
Lucas Smith
9fdc9dcbf7 Merge pull request #256 from nsylke/nsylke-patch-2
Add husky & lint staged
2023-08-17 11:07:18 +10:00
Nicholas Sylke
0a30403719 ci: remove --workspaces from the build script in ci workflow 2023-08-16 20:00:13 -05:00
Nicholas Sylke
0e1fcd86e6 ci: setup build workflow 2023-08-16 19:51:45 -05:00
Nicholas Sylke
8038f3ad00 fix: used wrong lockfile version when resolving conflicts 2023-08-16 13:00:50 -05:00
Timur Ercan
44369ee7f6 mention cals open startup article 2023-08-16 17:52:04 +02:00
Timur Ercan
7e46cb0d8e feat: pre seed announce and link on /open page 2023-08-16 17:42:27 +02:00
Nicholas Sylke
10e39246ce Merge branch 'feat/refresh' into nsylke-patch-2
# Conflicts:
#	package-lock.json
2023-08-16 07:34:40 -05:00
Timur Ercan
5e45767e44 Merge pull request #249 from documenso/feat/open-page
feat: add cap table to open page
2023-08-16 14:09:01 +02:00
Timur Ercan
61d7f7cbcd chore: whitespace 2023-08-16 14:08:21 +02:00
Timur Ercan
8f3c47d659 Merge branch 'feat/refresh' into feat/open-page 2023-08-16 14:05:18 +02:00
Timur Ercan
3b9c57fe5c chore: remove double emtpy state add CTA 2023-08-16 13:49:19 +02:00
Nicholas Sylke
6017d35cfd refactor: future proofing the prettier/lint-staged for js/ts filetypes 2023-08-16 06:27:45 -05:00
Timur Ercan
90e28cd3a4 chore: status order to figma 2023-08-16 09:29:16 +02:00
Timur Ercan
e743e56787 remove dashboard and link bar 2023-08-16 09:03:28 +02:00
Nicholas Sylke
ba25ea1370 refactor: use lint-staged.config.cjs as configuration for lint-staged 2023-08-15 16:02:58 -05:00
Ephraim Atta-Duncan
b7543298e1 fix: ssr hydration error in piechart 2023-08-15 18:02:10 +00:00
Timur Ercan
29b4cb7793 chore: add total 2023-08-15 14:00:05 +02:00
Ephraim Atta-Duncan
f7c3190346 chore: fix ts errors in metrics 2023-08-15 11:13:13 +00:00
Ephraim Atta-Duncan
5130dc5f31 chore: refactor github charts into a single component 2023-08-15 09:43:24 +00:00
Ephraim Atta-Duncan
d3cdd2c317 chore: use correct names on tooltip 2023-08-15 09:17:51 +00:00
Ephraim Atta-Duncan
96f7ca4e36 feat: add other charts 2023-08-15 08:45:24 +00:00
Ephraim Atta-Duncan
e2471a8eb4 chore: fix eslint error in data 2023-08-14 22:03:56 +00:00
Ephraim Atta-Duncan
5f33b1da1e chore: format date 2023-08-14 22:01:25 +00:00
Ephraim Atta-Duncan
bca048c026 chore: fetch stargazers data from stargazers api 2023-08-14 21:51:38 +00:00
Ephraim Atta-Duncan
f999ca48f6 feat: add github stars cummulative 2023-08-14 21:33:16 +00:00
Nicholas Sylke
f0c607d87a add husky and lint-staged to ensure commits are formatted 2023-08-14 16:14:53 -05:00
Timur Ercan
6f394138f5 chore: team updates, funding cummulative 2023-08-14 14:16:04 +02:00
Ephraim Atta-Duncan
b710693009 feat: add team members engagement to open page 2023-08-08 01:53:56 +00:00
Lucas Smith
fb4b96a838 Merge pull request #246 from fmerian/feat/refresh
Edit blog post
2023-08-07 11:24:36 +10:00
Ephraim Atta-Duncan
af2dae8822 --amend 2023-08-06 23:01:33 +00:00
Ephraim Atta-Duncan
e400dbe2ea feat: add tooltip to cap table 2023-08-06 22:59:09 +00:00
Ephraim Atta-Duncan
b718bdeb15 Add initial cap table 2023-08-06 22:46:20 +00:00
Mythie
9ca84f5ede chore: add contributor license agreement 2023-08-05 17:44:39 +10:00
flō
1a31cc321c fix typo 2023-08-04 08:25:51 +02:00
flō
2ec3cebcc9 Optimize description 2023-08-03 12:32:27 +02:00
flō
659af87592 Edit content 2023-08-03 11:40:00 +02:00
Lucas Smith
beb1a4c214 Merge pull request #243 from fmerian/feat/refresh
Add new blog post: Switching to Discord
2023-08-02 20:09:01 +10:00
flō
16a7030922 Edit blog post description 2023-08-02 11:27:07 +02:00
flō
c036858d45 Update link to community (Discord) 2023-08-02 11:16:04 +02:00
flō
84d295e324 Update link to community (Discord) 2023-08-02 11:15:08 +02:00
flō
90eb54f768 Add blog post: Switching to Discord 2023-08-02 11:11:29 +02:00
flō
547ed337a6 Add profile picture: Flo 2023-08-02 10:57:29 +02:00
Lucas Smith
3f5937717f Merge pull request #238 from fmerian/fix-blog
Update blog
2023-08-02 17:52:17 +10:00
flō
3cdfde5e0f fix mailto 2023-08-02 09:07:34 +02:00
Ephraim Atta-Duncan
6b1fcb8193 feat: open page 2023-08-01 17:43:11 +10:00
Mythie
9431e7f0ad chore: upgrade deps and linting 2023-08-01 17:34:17 +10:00
flō
817569a333 fix typo 2023-07-31 11:26:43 +02:00
flō
0bbaa64080 edit announcing-documenso.mdx
- fix typo for consistency in tone and voice
- edit filename for SEO
2023-07-31 10:39:05 +02:00
flō
c403812389 edit manifest.mdx
- fix typo in caption for consistency
- edit filename (URL) for SEO
2023-07-31 10:26:30 +02:00
Lucas Smith
25d7390b27 Merge pull request #207 from doug-andrade/v2-google-auth
feat: add google as auth provider  **no schema change**
2023-07-31 13:55:25 +10:00
Mythie
918018c7ca fix: improve typesafety 2023-07-31 13:53:55 +10:00
Mythie
58baf5ddf4 Merge branch 'feat/refresh' into v2-google-auth 2023-07-31 13:03:32 +10:00
Mythie
32dcd4aa0e chore: add oss friends page 2023-07-29 17:39:08 +10:00
Lucas Smith
cacfc2c535 Merge pull request #236 from documenso/feat/content-layer
feat: add content layer
2023-07-29 00:25:26 +10:00
Mythie
8115ea3bf2 fix: type errors 2023-07-28 20:16:06 +10:00
Mythie
c64ff8ec95 fix: styling updates 2023-07-28 20:14:04 +10:00
David Nguyen
38323b5ea5 feat: update privacy content 2023-07-28 16:31:10 +10:00
David Nguyen
34d10bd313 feat: update blog styling 2023-07-28 11:19:52 +10:00
David Nguyen
d743f8411a feat: update privacy content 2023-07-28 11:07:01 +10:00
David Nguyen
d8a6aa2686 feat: remove whitespace 2023-07-28 10:54:03 +10:00
David Nguyen
dfcfe1d8d2 feat: add generic content page 2023-07-28 09:58:47 +10:00
David Nguyen
6038c3cc78 Update apps/marketing/content/blog/announcing-documenso.mdx
Co-authored-by: Joshua Sharp <joshuafsharp@gmail.com>
2023-07-28 09:12:37 +10:00
David Nguyen
97efcf3d62 feat: add content layer
Add blog pages

Add privacy page
2023-07-27 18:29:22 +10:00
Lucas Smith
889ad1c49f Merge pull request #217 from documenso/feat/stacked-avatars
feat: stack avatars
2023-07-26 19:58:34 +10:00
Mythie
b3fa837967 feat: use server-actions for authoring flow
This change actually makes the authoring flow work for
the most part by tying in emailing and more.

We have also done a number of quality of life updates to
simplify the codebase overall making it easier to continue
work on the refresh.
2023-07-26 18:52:53 +10:00
Ephraim Atta-Duncan
a5334ca6e6 refactor: read z-index values from an object 2023-07-05 20:47:12 +00:00
Ephraim Atta-Duncan
0ad0524157 Merge branch 'feat/refresh' into feat/stacked-avatars 2023-07-01 01:16:58 +00:00
Ephraim Atta-Duncan
b50f64d4ad fix: update types from code review 2023-06-30 23:49:34 +00:00
Ephraim Atta-Duncan
88d15376e3 feat: update stack avatar with changes from code review 2023-06-30 23:38:37 +00:00
Ephraim Atta-Duncan
aa884310eb feat: add recipients avatars on all tables 2023-06-25 15:14:48 +00:00
Ephraim Atta-Duncan
dbcf7771b9 chore: refactor stacked avatars into component 2023-06-25 14:23:18 +00:00
Mythie
60b150cc58 fix: add shadow to metric-card 2023-06-24 15:01:18 +10:00
Mythie
bd0db0f8fd feat: email templates
adds email templates using `react-email` which will be used for invites,
signing and document completion.

authored by @dephraiim
2023-06-24 14:59:08 +10:00
Ephraim Atta-Duncan
2e8e39c5a9 feat: add tooltip on hover on stacked avatars 2023-06-23 20:19:25 +00:00
Ephraim Atta-Duncan
f22baca569 feat: stack recipients avatars on dashboard 2023-06-23 12:20:49 +00:00
Mythie
d8a094a324 chore: use jsonprotocol 2023-06-23 18:06:02 +10:00
Lucas Smith
4b063b68ab Merge pull request #214 from doug-andrade/refresh/dashboard-filters
linking card metrics to filtered /documents
2023-06-22 08:09:16 +10:00
Doug Andrade
3c02331cb9 linking card metrics to filtered /documents 2023-06-21 17:57:02 -04:00
Mythie
eea09dcfac feat: persist fields and recipients for document editing 2023-06-21 23:49:23 +10:00
Mythie
3aea62e898 fix: styling and semantic updates 2023-06-21 23:48:22 +10:00
Lucas Smith
76674523c5 Merge pull request #208 from doug-andrade/refesh/document-loading
improved loading state for /document/id
2023-06-16 00:19:37 +10:00
Doug Andrade
e0e2f3e440 improved loading state for /document/id 2023-06-13 23:28:25 -04:00
Doug Andrade
d1bc948f3c clean up console.log() used for testing 2023-06-13 02:00:45 -04:00
Doug Andrade
2b84636993 feat: google auth without schema change 2023-06-13 01:53:12 -04:00
Lucas Smith
05238f096b feat: dark mode & theme switching
feat: dark mode & theme switching
2023-06-12 16:01:02 +10:00
Doug Andrade
dd83d4607c fix: dark mode on signup and signin pages 2023-06-11 12:26:47 -04:00
Doug Andrade
07d13c74f5 fix: signature pad in dark mode 2023-06-11 11:36:13 -04:00
Doug Andrade
64d1d6df37 resolving eslint build errors 2023-06-11 02:21:13 -04:00
Doug Andrade
877a579533 adding dark mode to feat/refresh 2023-06-11 01:50:19 -04:00
Mythie
b0e364acf4 wip: create document workflow 2023-06-10 22:33:12 +10:00
Mythie
803ebccee3 wip: refresh design 2023-06-09 18:22:21 +10:00
153 changed files with 4806 additions and 1201 deletions

View File

@@ -2,6 +2,11 @@
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="secret"
# [[CRYPTO]]
# Application Key for symmetric encryption and decryption
# This should be a random string of at least 32 characters
NEXT_PRIVATE_ENCRYPTION_KEY="CAFEBABE"
# [[AUTH OPTIONAL]]
NEXT_PRIVATE_GOOGLE_CLIENT_ID=""
NEXT_PRIVATE_GOOGLE_CLIENT_SECRET=""
@@ -18,21 +23,21 @@ NEXT_PRIVATE_DIRECT_DATABASE_URL="postgres://documenso:password@127.0.0.1:54320/
# [[E2E Tests]]
E2E_TEST_AUTHENTICATE_USERNAME="Test User"
E2E_TEST_AUTHENTICATE_USER_EMAIL="testuser@mail.com"
E2E_TEST_AUTHENTICATE_USER_PASSWORD="test_password"
E2E_TEST_AUTHENTICATE_USER_PASSWORD="test_Password123"
# [[STORAGE]]
# OPTIONAL: Defines the storage transport to use. Available options: database (default) | s3
NEXT_PUBLIC_UPLOAD_TRANSPORT="database"
# OPTIONAL: Defines the endpoint to use for the S3 storage transport. Relevant when using third-party S3-compatible providers.
NEXT_PRIVATE_UPLOAD_ENDPOINT=
NEXT_PRIVATE_UPLOAD_ENDPOINT="http://127.0.0.1:9002"
# OPTIONAL: Defines the region to use for the S3 storage transport. Defaults to us-east-1.
NEXT_PRIVATE_UPLOAD_REGION=
NEXT_PRIVATE_UPLOAD_REGION="unknown"
# REQUIRED: Defines the bucket to use for the S3 storage transport.
NEXT_PRIVATE_UPLOAD_BUCKET=
NEXT_PRIVATE_UPLOAD_BUCKET="documenso"
# OPTIONAL: Defines the access key ID to use for the S3 storage transport.
NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=
NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID="documenso"
# OPTIONAL: Defines the secret access key to use for the S3 storage transport.
NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=
NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY="password"
# [[SMTP]]
# OPTIONAL: Defines the transport to use for sending emails. Available options: smtp-auth (default) | smtp-api | mailchannels

View File

@@ -1,5 +1,5 @@
name: "Bug Report"
labels: ["bug"]
labels: "bug"
description: Create a bug report to help us improve
body:
- type: markdown
@@ -45,4 +45,4 @@ body:
- label: I have included relevant environment information.
- label: I have included any relevant screenshots.
- label: I understand that this is a voluntary contribution and that there is no guarantee of resolution.
- label: I want to work on creating a PR for this issue if approved
- label: I want to work on creating a PR for this issue if approved

View File

@@ -5,7 +5,7 @@ updates:
directory: '/'
schedule:
interval: "weekly"
target-branch: "main"
target-branch: "feat/refresh"
labels:
- "ci dependencies"
- "ci"
@@ -15,7 +15,7 @@ updates:
directory: "/apps/marketing"
schedule:
interval: "weekly"
target-branch: "main"
target-branch: "feat/refresh"
labels:
- "npm dependencies"
- "frontend"
@@ -25,7 +25,7 @@ updates:
directory: "/apps/web"
schedule:
interval: "weekly"
target-branch: "main"
target-branch: "feat/refresh"
labels:
- "npm dependencies"
- "frontend"

View File

@@ -2,9 +2,9 @@ name: "Continuous Integration"
on:
push:
branches: [ "main" ]
branches: [ "feat/refresh" ]
pull_request:
branches: [ "main" ]
branches: [ "feat/refresh" ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

View File

@@ -3,9 +3,9 @@ name: "CodeQL"
on:
workflow_dispatch:
push:
branches: [ "main" ]
branches: [ feat/refresh ]
pull_request:
branches: [ "main" ]
branches: [ feat/refresh ]
jobs:
analyze:

View File

@@ -1,9 +1,9 @@
name: Playwright Tests
on:
push:
branches: [ "main" ]
branches: [feat/refresh]
pull_request:
branches: [ "main" ]
branches: [feat/refresh]
jobs:
e2e_tests:
timeout-minutes: 60

16
.prettierignore Normal file
View File

@@ -0,0 +1,16 @@
node_modules
.next
public
**/**/node_modules
**/**/.next
**/**/public
*.lock
*.log
*.test.ts
.gitignore
.npmignore
.prettierignore
.DS_Store
.eslintignore

View File

@@ -37,7 +37,7 @@ The development branch is <code>main</code>. All pull requests should be made ag
- Create a new branch (include the issue id and something readable):
```sh
git checkout -b feat/doc-999-somefeature-that-rocks
git checkout -b doc-999-my-feature-or-fix
```
3. See the [Developer Setup](https://github.com/documenso/documenso/blob/main/README.md#developer-setup) for more setup details.

View File

@@ -1,6 +0,0 @@
# The Documenso Manifest
Signing documents is a fundamental building block of private, economic, and government interactions. Access to easy and secure signing to participate in society should therefore be a fundamental right for everyone. The technology to enable this should be accessible and widespread.
We know that open source is the key to solving this need once and for all to benefit all humankind. Using open source kickstarts innovation by putting the open sharing of ideas and solutions first. With Documenso, we will create an open and globally accessible signing platform to empower users, customers, and developers to fulfill their needs. Documenso is built by and for the global community, listening and implementing what is needed. Being transparent with the code and the processes that use it brings trust and security to the platform.
We build Documenso for longevity and scale by embracing the capital efficiency and inclusiveness of the Commercial Open Source (COSS) movement. We are building a global commodity for the world.

View File

@@ -1,3 +1,5 @@
🚨 We are live on Product Hunt with Single Player Mode and the new free tier: [https://www.producthunt.com/products/documenso](https://www.producthunt.com/posts/documenso-singleplayer-mode)
<img src="https://github.com/documenso/documenso/assets/13398220/a643571f-0239-46a6-a73e-6bef38d1228b" alt="Documenso Logo">
<p align="center" style="margin-top: 20px">
@@ -139,11 +141,13 @@ npm run d
1. **App** - http://localhost:3000
2. **Incoming Mail Access** - http://localhost:9000
3. **Database Connection Details**
- **Port**: 54320
- **Connection**: Use your favorite database client to connect using the provided port.
4. **S3 Storage Dashboard** - http://localhost:9001
## Developer Setup
### Manual Setup

View File

@@ -8,6 +8,7 @@
"build": "next build",
"start": "next start -p 3001",
"lint": "next lint",
"lint:fix": "next lint --fix",
"clean": "rimraf .next && rimraf node_modules",
"copy:pdfjs": "node ../../scripts/copy-pdfjs.cjs"
},

View File

@@ -18,6 +18,14 @@ export const revalidate = 3600;
export const dynamic = 'force-dynamic';
const GITHUB_HEADERS: Record<string, string> = {
accept: 'application/vnd.github.v3+json',
};
if (process.env.NEXT_PRIVATE_GITHUB_TOKEN) {
GITHUB_HEADERS.authorization = `Bearer ${process.env.NEXT_PRIVATE_GITHUB_TOKEN}`;
}
const ZGithubStatsResponse = z.object({
stargazers_count: z.number(),
forks_count: z.number(),
@@ -28,6 +36,10 @@ const ZMergedPullRequestsResponse = z.object({
total_count: z.number(),
});
const ZOpenIssuesResponse = z.object({
total_count: z.number(),
});
const ZStargazersLiveResponse = z.record(
z.object({
stars: z.number(),
@@ -48,49 +60,76 @@ const ZEarlyAdoptersResponse = z.record(
export type StargazersType = z.infer<typeof ZStargazersLiveResponse>;
export type EarlyAdoptersType = z.infer<typeof ZEarlyAdoptersResponse>;
export default async function OpenPage() {
const GITHUB_HEADERS: Record<string, string> = {
accept: 'application/vnd.github.v3+json',
};
if (process.env.NEXT_PRIVATE_GITHUB_TOKEN) {
GITHUB_HEADERS.authorization = `Bearer ${process.env.NEXT_PRIVATE_GITHUB_TOKEN}`;
}
const {
forks_count: forksCount,
open_issues: openIssues,
stargazers_count: stargazersCount,
} = await fetch('https://api.github.com/repos/documenso/documenso', {
headers: GITHUB_HEADERS,
const fetchGithubStats = async () => {
return await fetch('https://api.github.com/repos/documenso/documenso', {
headers: {
...GITHUB_HEADERS,
},
})
.then(async (res) => res.json())
.then((res) => ZGithubStatsResponse.parse(res));
};
const { total_count: mergedPullRequests } = await fetch(
const fetchOpenIssues = async () => {
return await fetch(
'https://api.github.com/search/issues?q=repo:documenso/documenso+type:issue+state:open&page=0&per_page=1',
{
headers: {
...GITHUB_HEADERS,
},
},
)
.then(async (res) => res.json())
.then((res) => ZOpenIssuesResponse.parse(res));
};
const fetchMergedPullRequests = async () => {
return await fetch(
'https://api.github.com/search/issues?q=repo:documenso/documenso/+is:pr+merged:>=2010-01-01&page=0&per_page=1',
{
headers: GITHUB_HEADERS,
headers: {
...GITHUB_HEADERS,
},
},
)
.then(async (res) => res.json())
.then((res) => ZMergedPullRequestsResponse.parse(res));
};
const STARGAZERS_DATA = await fetch('https://stargrazer-live.onrender.com/api/stats', {
const fetchStargazers = async () => {
return await fetch('https://stargrazer-live.onrender.com/api/stats', {
headers: {
accept: 'application/json',
},
})
.then(async (res) => res.json())
.then((res) => ZStargazersLiveResponse.parse(res));
};
const EARLY_ADOPTERS_DATA = await fetch('https://stargrazer-live.onrender.com/api/stats/stripe', {
const fetchEarlyAdopters = async () => {
return await fetch('https://stargrazer-live.onrender.com/api/stats/stripe', {
headers: {
accept: 'application/json',
},
})
.then(async (res) => res.json())
.then((res) => ZEarlyAdoptersResponse.parse(res));
};
export default async function OpenPage() {
const [
{ forks_count: forksCount, stargazers_count: stargazersCount },
{ total_count: openIssues },
{ total_count: mergedPullRequests },
STARGAZERS_DATA,
EARLY_ADOPTERS_DATA,
] = await Promise.all([
fetchGithubStats(),
fetchOpenIssues(),
fetchMergedPullRequests(),
fetchStargazers(),
fetchEarlyAdopters(),
]);
const MONTHLY_USERS = await getUserMonthlyGrowth();

View File

@@ -8,18 +8,19 @@ import { useRouter } from 'next/navigation';
import { useAnalytics } from '@documenso/lib/client-only/hooks/use-analytics';
import { base64 } from '@documenso/lib/universal/base64';
import { putFile } from '@documenso/lib/universal/upload/put-file';
import { DocumentDataType, Field, Prisma, Recipient } from '@documenso/prisma/client';
import type { Field, Recipient } from '@documenso/prisma/client';
import { DocumentDataType, Prisma } from '@documenso/prisma/client';
import { Card, CardContent } from '@documenso/ui/primitives/card';
import { DocumentDropzone } from '@documenso/ui/primitives/document-dropzone';
import { AddFieldsFormPartial } from '@documenso/ui/primitives/document-flow/add-fields';
import { TAddFieldsFormSchema } from '@documenso/ui/primitives/document-flow/add-fields.types';
import type { TAddFieldsFormSchema } from '@documenso/ui/primitives/document-flow/add-fields.types';
import { AddSignatureFormPartial } from '@documenso/ui/primitives/document-flow/add-signature';
import { TAddSignatureFormSchema } from '@documenso/ui/primitives/document-flow/add-signature.types';
import type { TAddSignatureFormSchema } from '@documenso/ui/primitives/document-flow/add-signature.types';
import {
DocumentFlowFormContainer,
DocumentFlowFormContainerHeader,
} from '@documenso/ui/primitives/document-flow/document-flow-root';
import { DocumentFlowStep } from '@documenso/ui/primitives/document-flow/types';
import type { DocumentFlowStep } from '@documenso/ui/primitives/document-flow/types';
import { LazyPDFViewer } from '@documenso/ui/primitives/lazy-pdf-viewer';
import { useToast } from '@documenso/ui/primitives/use-toast';

View File

@@ -5,13 +5,12 @@ import { HTMLAttributes } from 'react';
import Image from 'next/image';
import Link from 'next/link';
import { Moon, Sun } from 'lucide-react';
import { useTheme } from 'next-themes';
import { FaXTwitter } from 'react-icons/fa6';
import { LiaDiscord } from 'react-icons/lia';
import { LuGithub } from 'react-icons/lu';
import { cn } from '@documenso/ui/lib/utils';
import { ThemeSwitcher } from '@documenso/ui/primitives/theme-switcher';
export type FooterProps = HTMLAttributes<HTMLDivElement>;
@@ -34,8 +33,6 @@ const FOOTER_LINKS = [
];
export const Footer = ({ className, ...props }: FooterProps) => {
const { setTheme } = useTheme();
return (
<div className={cn('border-t py-12', className)} {...props}>
<div className="mx-auto flex w-full max-w-screen-xl flex-wrap items-start justify-between gap-8 px-8">
@@ -77,21 +74,13 @@ export const Footer = ({ className, ...props }: FooterProps) => {
))}
</div>
</div>
<div className="mx-auto mt-4 flex w-full max-w-screen-xl flex-wrap justify-between gap-4 px-8 md:mt-12 lg:mt-24">
<div className="mx-auto mt-4 flex w-full max-w-screen-xl flex-wrap items-center justify-between gap-4 px-8 md:mt-12 lg:mt-24">
<p className="text-muted-foreground text-sm">
© {new Date().getFullYear()} Documenso, Inc. All rights reserved.
</p>
<div className="flex flex-wrap items-center gap-x-4 gap-y-2.5">
<button type="button" className="text-muted-foreground" onClick={() => setTheme('light')}>
<Sun className="h-5 w-5" />
<span className="sr-only">Light</span>
</button>
<button type="button" className="text-muted-foreground" onClick={() => setTheme('dark')}>
<Moon className="h-5 w-5" />
<span className="sr-only">Dark</span>
</button>
<div className="flex flex-wrap">
<ThemeSwitcher />
</div>
</div>
</div>

View File

@@ -10,6 +10,7 @@ import { z } from 'zod';
import { mailer } from '@documenso/email/mailer';
import { render } from '@documenso/email/render';
import { DocumentSelfSignedEmailTemplate } from '@documenso/email/templates/document-self-signed';
import { DEFAULT_DOCUMENT_DATE_FORMAT } from '@documenso/lib/constants/date-formats';
import { FROM_ADDRESS, FROM_NAME, SERVICE_USER_EMAIL } from '@documenso/lib/constants/email';
import { insertFieldInPDF } from '@documenso/lib/server-only/pdf/insert-field-in-pdf';
import { alphaid } from '@documenso/lib/universal/id';
@@ -215,7 +216,7 @@ const mapField = (
signer: TCreateSinglePlayerDocumentSchema['signer'],
) => {
const customText = match(field.type)
.with(FieldType.DATE, () => DateTime.now().toFormat('yyyy-MM-dd hh:mm a'))
.with(FieldType.DATE, () => DateTime.now().toFormat(DEFAULT_DOCUMENT_DATE_FORMAT))
.with(FieldType.EMAIL, () => signer.email)
.with(FieldType.NAME, () => signer.name)
.otherwise(() => '');

View File

@@ -1,4 +1,4 @@
import { NextApiRequest, NextApiResponse } from 'next';
import type { NextApiRequest, NextApiResponse } from 'next';
import { randomBytes } from 'crypto';
import { readFileSync } from 'fs';
@@ -7,7 +7,8 @@ import { buffer } from 'micro';
import { insertImageInPDF } from '@documenso/lib/server-only/pdf/insert-image-in-pdf';
import { insertTextInPDF } from '@documenso/lib/server-only/pdf/insert-text-in-pdf';
import { redis } from '@documenso/lib/server-only/redis';
import { Stripe, stripe } from '@documenso/lib/server-only/stripe';
import type { Stripe } from '@documenso/lib/server-only/stripe';
import { stripe } from '@documenso/lib/server-only/stripe';
import { getFile } from '@documenso/lib/universal/upload/get-file';
import { updateFile } from '@documenso/lib/universal/upload/update-file';
import { prisma } from '@documenso/prisma';

View File

@@ -12,6 +12,7 @@ ENV_FILES.forEach((file) => {
/** @type {import('next').NextConfig} */
const config = {
output: process.env.DOCKER_OUTPUT ? 'standalone' : undefined,
experimental: {
serverActionsBodySizeLimit: '50mb',
},

View File

@@ -8,6 +8,7 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint:fix": "next lint --fix",
"clean": "rimraf .next && rimraf node_modules",
"copy:pdfjs": "node ../../scripts/copy-pdfjs.cjs"
},
@@ -42,6 +43,7 @@
"sharp": "0.32.5",
"ts-pattern": "^5.0.5",
"typescript": "5.2.2",
"uqr": "^0.1.2",
"zod": "^3.22.4"
},
"devDependencies": {

View File

@@ -2,7 +2,7 @@ import React from 'react';
import { redirect } from 'next/navigation';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
import { isAdmin } from '@documenso/lib/next-auth/guards/is-admin';
import { AdminNav } from './nav';

View File

@@ -4,12 +4,11 @@ import { useRouter } from 'next/navigation';
import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import { z } from 'zod';
import type { z } from 'zod';
import { trpc } from '@documenso/trpc/react';
import { ZUpdateProfileMutationByAdminSchema } from '@documenso/trpc/server/admin-router/schema';
import { Button } from '@documenso/ui/primitives/button';
import { Combobox } from '@documenso/ui/primitives/combobox';
import {
Form,
FormControl,
@@ -19,6 +18,7 @@ import {
FormMessage,
} from '@documenso/ui/primitives/form/form';
import { Input } from '@documenso/ui/primitives/input';
import { MultiSelectCombobox } from '@documenso/ui/primitives/multiselect-combobox';
import { useToast } from '@documenso/ui/primitives/use-toast';
const ZUserFormSchema = ZUpdateProfileMutationByAdminSchema.omit({ id: true });
@@ -117,7 +117,7 @@ export default function UserPage({ params }: { params: { id: number } }) {
<fieldset className="flex flex-col gap-2">
<FormLabel className="text-muted-foreground">Roles</FormLabel>
<FormControl>
<Combobox
<MultiSelectCombobox
listValues={roles}
onChange={(values: string[]) => onChange(values)}
/>

View File

@@ -4,21 +4,21 @@ import { useState } from 'react';
import { useRouter } from 'next/navigation';
import { DocumentData, Field, Recipient, User } from '@documenso/prisma/client';
import { DocumentWithData } from '@documenso/prisma/types/document-with-data';
import type { DocumentData, Field, Recipient, User } from '@documenso/prisma/client';
import type { DocumentWithData } from '@documenso/prisma/types/document-with-data';
import { cn } from '@documenso/ui/lib/utils';
import { Card, CardContent } from '@documenso/ui/primitives/card';
import { AddFieldsFormPartial } from '@documenso/ui/primitives/document-flow/add-fields';
import { TAddFieldsFormSchema } from '@documenso/ui/primitives/document-flow/add-fields.types';
import type { TAddFieldsFormSchema } from '@documenso/ui/primitives/document-flow/add-fields.types';
import { AddSignersFormPartial } from '@documenso/ui/primitives/document-flow/add-signers';
import { TAddSignersFormSchema } from '@documenso/ui/primitives/document-flow/add-signers.types';
import type { TAddSignersFormSchema } from '@documenso/ui/primitives/document-flow/add-signers.types';
import { AddSubjectFormPartial } from '@documenso/ui/primitives/document-flow/add-subject';
import { TAddSubjectFormSchema } from '@documenso/ui/primitives/document-flow/add-subject.types';
import type { TAddSubjectFormSchema } from '@documenso/ui/primitives/document-flow/add-subject.types';
import {
DocumentFlowFormContainer,
DocumentFlowFormContainerHeader,
} from '@documenso/ui/primitives/document-flow/document-flow-root';
import { DocumentFlowStep } from '@documenso/ui/primitives/document-flow/types';
import type { DocumentFlowStep } from '@documenso/ui/primitives/document-flow/types';
import { LazyPDFViewer } from '@documenso/ui/primitives/lazy-pdf-viewer';
import { useToast } from '@documenso/ui/primitives/use-toast';
@@ -117,14 +117,16 @@ export const EditDocumentForm = ({
};
const onAddSubjectFormSubmit = async (data: TAddSubjectFormSchema) => {
const { subject, message } = data.email;
const { subject, message, timezone, dateFormat } = data.meta;
try {
await completeDocument({
documentId: document.id,
email: {
meta: {
subject,
message,
timezone,
dateFormat,
},
});

View File

@@ -3,7 +3,7 @@ import { redirect } from 'next/navigation';
import { ChevronLeft, Users2 } from 'lucide-react';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
import { getDocumentById } from '@documenso/lib/server-only/document/get-document-by-id';
import { getFieldsForDocument } from '@documenso/lib/server-only/field/get-fields-for-document';
import { getRecipientsForDocument } from '@documenso/lib/server-only/recipient/get-recipients-for-document';

View File

@@ -0,0 +1,185 @@
'use client';
import { useState } from 'react';
import { zodResolver } from '@hookform/resolvers/zod';
import { History } from 'lucide-react';
import { useForm } from 'react-hook-form';
import * as z from 'zod';
import { getRecipientType } from '@documenso/lib/client-only/recipient-type';
import { recipientAbbreviation } from '@documenso/lib/utils/recipient-formatter';
import { type Document, type Recipient, SigningStatus } from '@documenso/prisma/client';
import { trpc as trpcReact } from '@documenso/trpc/react';
import { cn } from '@documenso/ui/lib/utils';
import { Button } from '@documenso/ui/primitives/button';
import { Checkbox } from '@documenso/ui/primitives/checkbox';
import {
Dialog,
DialogClose,
DialogContent,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from '@documenso/ui/primitives/dialog';
import { DropdownMenuItem } from '@documenso/ui/primitives/dropdown-menu';
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
} from '@documenso/ui/primitives/form/form';
import { useToast } from '@documenso/ui/primitives/use-toast';
import { StackAvatar } from '~/components/(dashboard)/avatar/stack-avatar';
const FORM_ID = 'resend-email';
export type ResendDocumentActionItemProps = {
document: Document;
recipients: Recipient[];
};
export const ZResendDocumentFormSchema = z.object({
recipients: z.array(z.number()).min(1, {
message: 'You must select at least one item.',
}),
});
export type TResendDocumentFormSchema = z.infer<typeof ZResendDocumentFormSchema>;
export const ResendDocumentActionItem = ({
document,
recipients,
}: ResendDocumentActionItemProps) => {
const { toast } = useToast();
const [isOpen, setIsOpen] = useState(false);
const isDisabled =
document.status !== 'PENDING' ||
!recipients.some((r) => r.signingStatus === SigningStatus.NOT_SIGNED);
const { mutateAsync: resendDocument } = trpcReact.document.resendDocument.useMutation();
const form = useForm<TResendDocumentFormSchema>({
resolver: zodResolver(ZResendDocumentFormSchema),
defaultValues: {
recipients: [],
},
});
const {
handleSubmit,
formState: { isSubmitting },
} = form;
const onFormSubmit = async ({ recipients }: TResendDocumentFormSchema) => {
try {
await resendDocument({ documentId: document.id, recipients });
toast({
title: 'Document re-sent',
description: 'Your document has been re-sent successfully.',
duration: 5000,
});
setIsOpen(false);
} catch (err) {
toast({
title: 'Something went wrong',
description: 'This document could not be re-sent at this time. Please try again.',
variant: 'destructive',
duration: 7500,
});
}
};
return (
<>
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogTrigger asChild>
<DropdownMenuItem disabled={isDisabled} onSelect={(e) => e.preventDefault()}>
<History className="mr-2 h-4 w-4" />
Resend
</DropdownMenuItem>
</DialogTrigger>
<DialogContent className="sm:max-w-sm" hideClose>
<DialogHeader>
<DialogTitle>
<h1 className="text-center text-xl">Who do you want to remind?</h1>
</DialogTitle>
</DialogHeader>
<Form {...form}>
<form id={FORM_ID} onSubmit={handleSubmit(onFormSubmit)} className="px-3">
<FormField
control={form.control}
name="recipients"
render={({ field: { value, onChange } }) => (
<>
{recipients.map((recipient) => (
<FormItem
key={recipient.id}
className="flex flex-row items-center justify-between gap-x-3"
>
<FormLabel
className={cn('my-2 flex items-center gap-2 font-normal', {
'opacity-50': !value.includes(recipient.id),
})}
>
<StackAvatar
key={recipient.id}
type={getRecipientType(recipient)}
fallbackText={recipientAbbreviation(recipient)}
/>
{recipient.email}
</FormLabel>
<FormControl>
<Checkbox
className="h-5 w-5 rounded-full data-[state=checked]:border-black data-[state=checked]:bg-black "
checkClassName="text-white"
value={recipient.id}
checked={value.includes(recipient.id)}
onCheckedChange={(checked: boolean) =>
checked
? onChange([...value, recipient.id])
: onChange(value.filter((v) => v !== recipient.id))
}
/>
</FormControl>
</FormItem>
))}
</>
)}
/>
</form>
</Form>
<DialogFooter>
<div className="flex w-full flex-1 flex-nowrap gap-4">
<DialogClose asChild>
<Button
type="button"
className="dark:bg-muted dark:hover:bg-muted/80 flex-1 bg-black/5 hover:bg-black/10"
variant="secondary"
disabled={isSubmitting}
>
Cancel
</Button>
</DialogClose>
<Button className="flex-1" loading={isSubmitting} type="submit" form={FORM_ID}>
Send reminder
</Button>
</div>
</DialogFooter>
</DialogContent>
</Dialog>
</>
);
};

View File

@@ -8,7 +8,6 @@ import {
Copy,
Download,
Edit,
History,
Loader,
MoreHorizontal,
Pencil,
@@ -19,8 +18,9 @@ import {
import { useSession } from 'next-auth/react';
import { getFile } from '@documenso/lib/universal/upload/get-file';
import { Document, DocumentStatus, Recipient, User } from '@documenso/prisma/client';
import { DocumentWithData } from '@documenso/prisma/types/document-with-data';
import type { Document, Recipient, User } from '@documenso/prisma/client';
import { DocumentStatus } from '@documenso/prisma/client';
import type { DocumentWithData } from '@documenso/prisma/types/document-with-data';
import { trpc as trpcClient } from '@documenso/trpc/client';
import { DocumentShareButton } from '@documenso/ui/components/document/document-share-button';
import {
@@ -31,6 +31,7 @@ import {
DropdownMenuTrigger,
} from '@documenso/ui/primitives/dropdown-menu';
import { ResendDocumentActionItem } from './_action-items/resend-document';
import { DeleteDraftDocumentDialog } from './delete-draft-document-dialog';
import { DuplicateDocumentDialog } from './duplicate-document-dialog';
@@ -96,6 +97,7 @@ export const DataTableActionDropdown = ({ row }: DataTableActionDropdownProps) =
window.URL.revokeObjectURL(link.href);
};
const nonSignedRecipients = row.Recipient.filter((item) => item.signingStatus !== 'SIGNED');
return (
<DropdownMenu>
<DropdownMenuTrigger>
@@ -141,10 +143,7 @@ export const DataTableActionDropdown = ({ row }: DataTableActionDropdownProps) =
<DropdownMenuLabel>Share</DropdownMenuLabel>
<DropdownMenuItem disabled>
<History className="mr-2 h-4 w-4" />
Resend
</DropdownMenuItem>
<ResendDocumentActionItem document={row} recipients={nonSignedRecipients} />
<DocumentShareButton
documentId={row.id}

View File

@@ -26,16 +26,11 @@ export const DuplicateDocumentDialog = ({
const router = useRouter();
const { toast } = useToast();
const { data, isLoading } = trpcReact.document.getDocumentById.useQuery({
const { data: document, isLoading } = trpcReact.document.getDocumentById.useQuery({
id,
});
const documentData = data?.documentData
? {
...data.documentData,
data: data.documentData.initialData,
}
: undefined;
const documentData = document?.documentData;
const { mutateAsync: duplicateDocument, isLoading: isDuplicateLoading } =
trpcReact.document.duplicateDocument.useMutation({
@@ -78,7 +73,7 @@ export const DuplicateDocumentDialog = ({
</div>
) : (
<div className="p-2 [&>div]:h-[50vh] [&>div]:overflow-y-scroll ">
<LazyPDFViewer key={data?.id} documentData={documentData} />
<LazyPDFViewer key={document?.id} documentData={documentData} />
</div>
)}

View File

@@ -1,6 +1,6 @@
import Link from 'next/link';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
import { findDocuments } from '@documenso/lib/server-only/document/find-documents';
import { getStats } from '@documenso/lib/server-only/document/get-stats';
import { isExtendedDocumentStatus } from '@documenso/prisma/guards/is-extended-document-status';
@@ -8,10 +8,8 @@ import { ExtendedDocumentStatus } from '@documenso/prisma/types/extended-documen
import { Tabs, TabsList, TabsTrigger } from '@documenso/ui/primitives/tabs';
import { PeriodSelector } from '~/components/(dashboard)/period-selector/period-selector';
import {
PeriodSelectorValue,
isPeriodSelectorValue,
} from '~/components/(dashboard)/period-selector/types';
import type { PeriodSelectorValue } from '~/components/(dashboard)/period-selector/types';
import { isPeriodSelectorValue } from '~/components/(dashboard)/period-selector/types';
import { DocumentStatus } from '~/components/formatter/document-status';
import { DocumentsDataTable } from './data-table';

View File

@@ -6,6 +6,7 @@ import Link from 'next/link';
import { useRouter } from 'next/navigation';
import { Loader } from 'lucide-react';
import { useSession } from 'next-auth/react';
import { useLimits } from '@documenso/ee/server-only/limits/provider/client';
import { createDocumentData } from '@documenso/lib/server-only/document-data/create-document-data';
@@ -23,6 +24,8 @@ export type UploadDocumentProps = {
export const UploadDocument = ({ className }: UploadDocumentProps) => {
const router = useRouter();
const { data: session } = useSession();
const { toast } = useToast();
const { quota, remaining } = useLimits();
@@ -79,7 +82,7 @@ export const UploadDocument = ({ className }: UploadDocumentProps) => {
<div className={cn('relative', className)}>
<DocumentDropzone
className="min-h-[40vh]"
disabled={remaining.documents === 0}
disabled={remaining.documents === 0 || !session?.user.emailVerified}
onDrop={onFileDrop}
/>

View File

@@ -6,9 +6,11 @@ import { getServerSession } from 'next-auth';
import { LimitsProvider } from '@documenso/ee/server-only/limits/provider/server';
import { NEXT_AUTH_OPTIONS } from '@documenso/lib/next-auth/auth-options';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
import { CommandMenu } from '~/components/(dashboard)/common/command-menu';
import { Header } from '~/components/(dashboard)/layout/header';
import { VerifyEmailBanner } from '~/components/(dashboard)/layout/verify-email-banner';
import { RefreshOnFocus } from '~/components/(dashboard)/refresh-on-focus/refresh-on-focus';
import { NextAuthProvider } from '~/providers/next-auth';
@@ -30,6 +32,8 @@ export default async function AuthenticatedDashboardLayout({
return (
<NextAuthProvider session={session}>
<LimitsProvider>
{!user.emailVerified && <VerifyEmailBanner email={user.email} />}
<CommandMenu />
<Header user={user} />
<main className="mt-8 pb-8 md:mt-12 md:pb-12">{children}</main>

View File

@@ -5,8 +5,9 @@ import {
getStripeCustomerById,
} from '@documenso/ee/server-only/stripe/get-customer';
import { getPortalSession } from '@documenso/ee/server-only/stripe/get-portal-session';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { Stripe, stripe } from '@documenso/lib/server-only/stripe';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
import type { Stripe } from '@documenso/lib/server-only/stripe';
import { stripe } from '@documenso/lib/server-only/stripe';
import { getSubscriptionByUserId } from '@documenso/lib/server-only/subscription/get-subscription-by-user-id';
export const createBillingPortal = async () => {

View File

@@ -7,8 +7,8 @@ import {
getStripeCustomerById,
} from '@documenso/ee/server-only/stripe/get-customer';
import { getPortalSession } from '@documenso/ee/server-only/stripe/get-portal-session';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { Stripe } from '@documenso/lib/server-only/stripe';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
import type { Stripe } from '@documenso/lib/server-only/stripe';
import { getSubscriptionByUserId } from '@documenso/lib/server-only/subscription/get-subscription-by-user-id';
export type CreateCheckoutOptions = {

View File

@@ -4,9 +4,9 @@ import { match } from 'ts-pattern';
import { getPricesByInterval } from '@documenso/ee/server-only/stripe/get-prices-by-interval';
import { getProductByPriceId } from '@documenso/ee/server-only/stripe/get-product-by-price-id';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
import { getServerComponentFlag } from '@documenso/lib/server-only/feature-flags/get-server-component-feature-flag';
import { Stripe } from '@documenso/lib/server-only/stripe';
import type { Stripe } from '@documenso/lib/server-only/stripe';
import { getSubscriptionByUserId } from '@documenso/lib/server-only/subscription/get-subscription-by-user-id';
import { LocaleDate } from '~/components/formatter/locale-date';
@@ -41,7 +41,7 @@ export default async function BillingSettingsPage() {
return (
<div>
<h3 className="text-lg font-medium">Billing</h3>
<h3 className="text-2xl font-semibold">Billing</h3>
<div className="text-muted-foreground mt-2 text-sm">
{isMissingOrInactiveOrFreePlan && (

View File

@@ -1,19 +1,5 @@
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { redirect } from 'next/navigation';
import { PasswordForm } from '~/components/forms/password';
export default async function PasswordSettingsPage() {
const { user } = await getRequiredServerComponentSession();
return (
<div>
<h3 className="text-lg font-medium">Password</h3>
<p className="text-muted-foreground mt-2 text-sm">Here you can update your password.</p>
<hr className="my-4" />
<PasswordForm user={user} className="max-w-xl" />
</div>
);
export default function PasswordSettingsPage() {
redirect('/settings/security');
}

View File

@@ -1,4 +1,4 @@
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
import { ProfileForm } from '~/components/forms/profile';
@@ -7,7 +7,7 @@ export default async function ProfileSettingsPage() {
return (
<div>
<h3 className="text-lg font-medium">Profile</h3>
<h3 className="text-2xl font-semibold">Profile</h3>
<p className="text-muted-foreground mt-2 text-sm">Here you can edit your personal details.</p>

View File

@@ -0,0 +1,46 @@
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
import { AuthenticatorApp } from '~/components/forms/2fa/authenticator-app';
import { RecoveryCodes } from '~/components/forms/2fa/recovery-codes';
import { PasswordForm } from '~/components/forms/password';
export default async function SecuritySettingsPage() {
const { user } = await getRequiredServerComponentSession();
return (
<div>
<h3 className="text-2xl font-semibold">Security</h3>
<p className="text-muted-foreground mt-2 text-sm">
Here you can manage your password and security settings.
</p>
<hr className="my-4" />
<PasswordForm user={user} className="max-w-xl" />
<hr className="mb-4 mt-8" />
<h4 className="text-lg font-medium">Two Factor Authentication</h4>
<p className="text-muted-foreground mt-2 text-sm">
Add and manage your two factor security settings to add an extra layer of security to your
account!
</p>
<div className="mt-4 max-w-xl">
<h5 className="font-medium">Two-factor methods</h5>
<AuthenticatorApp isTwoFactorEnabled={user.twoFactorEnabled} />
</div>
{user.twoFactorEnabled && (
<div className="mt-4 max-w-xl">
<h5 className="font-medium">Recovery methods</h5>
<RecoveryCodes isTwoFactorEnabled={user.twoFactorEnabled} />
</div>
)}
</div>
);
}

View File

@@ -6,8 +6,13 @@ import { useRouter } from 'next/navigation';
import { Loader } from 'lucide-react';
import { Recipient } from '@documenso/prisma/client';
import { FieldWithSignature } from '@documenso/prisma/types/field-with-signature';
import {
DEFAULT_DOCUMENT_DATE_FORMAT,
convertToLocalSystemFormat,
} from '@documenso/lib/constants/date-formats';
import { DEFAULT_DOCUMENT_TIME_ZONE } from '@documenso/lib/constants/time-zones';
import type { Recipient } from '@documenso/prisma/client';
import type { FieldWithSignature } from '@documenso/prisma/types/field-with-signature';
import { trpc } from '@documenso/trpc/react';
import { useToast } from '@documenso/ui/primitives/use-toast';
@@ -16,9 +21,16 @@ import { SigningFieldContainer } from './signing-field-container';
export type DateFieldProps = {
field: FieldWithSignature;
recipient: Recipient;
dateFormat?: string | null;
timezone?: string | null;
};
export const DateField = ({ field, recipient }: DateFieldProps) => {
export const DateField = ({
field,
recipient,
dateFormat = DEFAULT_DOCUMENT_DATE_FORMAT,
timezone = DEFAULT_DOCUMENT_TIME_ZONE,
}: DateFieldProps) => {
const router = useRouter();
const { toast } = useToast();
@@ -35,12 +47,18 @@ export const DateField = ({ field, recipient }: DateFieldProps) => {
const isLoading = isSignFieldWithTokenLoading || isRemoveSignedFieldWithTokenLoading || isPending;
const localDateString = convertToLocalSystemFormat(field.customText, dateFormat, timezone);
const isDifferentTimeZone = field.inserted && localDateString !== field.customText;
const tooltipText = `"${field.customText}" will appear on the document as it has a timezone of "${timezone}".`;
const onSign = async () => {
try {
await signFieldWithToken({
token: recipient.token,
fieldId: field.id,
value: '',
value: dateFormat ?? DEFAULT_DOCUMENT_DATE_FORMAT,
});
startTransition(() => router.refresh());
@@ -75,7 +93,13 @@ export const DateField = ({ field, recipient }: DateFieldProps) => {
};
return (
<SigningFieldContainer field={field} onSign={onSign} onRemove={onRemove}>
<SigningFieldContainer
field={field}
onSign={onSign}
onRemove={onRemove}
type="Date"
tooltipText={isDifferentTimeZone ? tooltipText : undefined}
>
{isLoading && (
<div className="bg-background absolute inset-0 flex items-center justify-center rounded-md">
<Loader className="text-primary h-5 w-5 animate-spin md:h-8 md:w-8" />
@@ -87,7 +111,7 @@ export const DateField = ({ field, recipient }: DateFieldProps) => {
)}
{field.inserted && (
<p className="text-muted-foreground text-sm duration-200">{field.customText}</p>
<p className="text-muted-foreground text-sm duration-200">{localDateString}</p>
)}
</SigningFieldContainer>
);

View File

@@ -6,8 +6,8 @@ import { useRouter } from 'next/navigation';
import { Loader } from 'lucide-react';
import { Recipient } from '@documenso/prisma/client';
import { FieldWithSignature } from '@documenso/prisma/types/field-with-signature';
import type { Recipient } from '@documenso/prisma/client';
import type { FieldWithSignature } from '@documenso/prisma/types/field-with-signature';
import { trpc } from '@documenso/trpc/react';
import { useToast } from '@documenso/ui/primitives/use-toast';
@@ -79,7 +79,7 @@ export const EmailField = ({ field, recipient }: EmailFieldProps) => {
};
return (
<SigningFieldContainer field={field} onSign={onSign} onRemove={onRemove}>
<SigningFieldContainer field={field} onSign={onSign} onRemove={onRemove} type="Email">
{isLoading && (
<div className="bg-background absolute inset-0 flex items-center justify-center rounded-md">
<Loader className="text-primary h-5 w-5 animate-spin md:h-8 md:w-8" />

View File

@@ -9,7 +9,7 @@ import { useForm } from 'react-hook-form';
import { completeDocumentWithToken } from '@documenso/lib/server-only/document/complete-document-with-token';
import { sortFieldsByPosition, validateFieldsInserted } from '@documenso/lib/utils/fields';
import { Document, Field, Recipient } from '@documenso/prisma/client';
import type { Document, Field, Recipient } from '@documenso/prisma/client';
import { FieldToolTip } from '@documenso/ui/components/field/field-tooltip';
import { cn } from '@documenso/ui/lib/utils';
import { Button } from '@documenso/ui/primitives/button';
@@ -19,6 +19,7 @@ import { Label } from '@documenso/ui/primitives/label';
import { SignaturePad } from '@documenso/ui/primitives/signature-pad';
import { useRequiredSigningContext } from './provider';
import { SignDialog } from './sign-dialog';
export type SigningFormProps = {
document: Document;
@@ -45,6 +46,7 @@ export const SigningForm = ({ document, recipient, fields }: SigningFormProps) =
const onFormSubmit = async () => {
setValidateUninsertedFields(true);
const isFieldsValid = validateFieldsInserted(fields);
if (!isFieldsValid) {
@@ -80,7 +82,11 @@ export const SigningForm = ({ document, recipient, fields }: SigningFormProps) =
disabled={isSubmitting}
className={cn('-mx-2 flex flex-1 flex-col overflow-hidden px-2')}
>
<div className={cn('flex flex-1 flex-col')}>
<div
className={cn(
'custom-scrollbar -mx-2 flex flex-1 flex-col overflow-y-auto overflow-x-hidden px-2',
)}
>
<h3 className="text-foreground text-2xl font-semibold">Sign Document</h3>
<p className="text-muted-foreground mt-2 text-sm">
@@ -132,9 +138,12 @@ export const SigningForm = ({ document, recipient, fields }: SigningFormProps) =
Cancel
</Button>
<Button className="w-full" type="submit" size="lg" loading={isSubmitting}>
Complete
</Button>
<SignDialog
isSubmitting={isSubmitting}
onSignatureComplete={handleSubmit(onFormSubmit)}
document={document}
fields={fields}
/>
</div>
</div>
</div>

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { getServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { getServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
import { Header as AuthenticatedHeader } from '~/components/(dashboard)/layout/header';
import { NextAuthProvider } from '~/providers/next-auth';

View File

@@ -6,8 +6,8 @@ import { useRouter } from 'next/navigation';
import { Loader } from 'lucide-react';
import { Recipient } from '@documenso/prisma/client';
import { FieldWithSignature } from '@documenso/prisma/types/field-with-signature';
import type { Recipient } from '@documenso/prisma/client';
import type { FieldWithSignature } from '@documenso/prisma/types/field-with-signature';
import { trpc } from '@documenso/trpc/react';
import { Button } from '@documenso/ui/primitives/button';
import { Dialog, DialogContent, DialogFooter, DialogTitle } from '@documenso/ui/primitives/dialog';
@@ -98,7 +98,7 @@ export const NameField = ({ field, recipient }: NameFieldProps) => {
};
return (
<SigningFieldContainer field={field} onSign={onSign} onRemove={onRemove}>
<SigningFieldContainer field={field} onSign={onSign} onRemove={onRemove} type="Name">
{isLoading && (
<div className="bg-background absolute inset-0 flex items-center justify-center rounded-md">
<Loader className="text-primary h-5 w-5 animate-spin md:h-8 md:w-8" />

View File

@@ -2,9 +2,12 @@ import { notFound, redirect } from 'next/navigation';
import { match } from 'ts-pattern';
import { DEFAULT_DOCUMENT_DATE_FORMAT } from '@documenso/lib/constants/date-formats';
import { PDF_VIEWER_PAGE_SELECTOR } from '@documenso/lib/constants/pdf-viewer';
import { getServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { DEFAULT_DOCUMENT_TIME_ZONE } from '@documenso/lib/constants/time-zones';
import { getServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
import { getDocumentAndSenderByToken } from '@documenso/lib/server-only/document/get-document-by-token';
import { getDocumentMetaByDocumentId } from '@documenso/lib/server-only/document/get-document-meta-by-document-id';
import { viewedDocument } from '@documenso/lib/server-only/document/viewed-document';
import { getFieldsForToken } from '@documenso/lib/server-only/field/get-fields-for-token';
import { getRecipientByToken } from '@documenso/lib/server-only/recipient/get-recipient-by-token';
@@ -40,6 +43,8 @@ export default async function SigningPage({ params: { token } }: SigningPageProp
viewedDocument({ token }).catch(() => null),
]);
const documentMeta = await getDocumentMetaByDocumentId({ id: document!.id }).catch(() => null);
if (!document || !document.documentData || !recipient) {
return notFound();
}
@@ -97,7 +102,13 @@ export default async function SigningPage({ params: { token } }: SigningPageProp
<NameField key={field.id} field={field} recipient={recipient} />
))
.with(FieldType.DATE, () => (
<DateField key={field.id} field={field} recipient={recipient} />
<DateField
key={field.id}
field={field}
recipient={recipient}
dateFormat={documentMeta?.dateFormat ?? DEFAULT_DOCUMENT_DATE_FORMAT}
timezone={documentMeta?.timezone ?? DEFAULT_DOCUMENT_TIME_ZONE}
/>
))
.with(FieldType.EMAIL, () => (
<EmailField key={field.id} field={field} recipient={recipient} />

View File

@@ -0,0 +1,77 @@
import { useState } from 'react';
import { Document, Field } from '@documenso/prisma/client';
import { Button } from '@documenso/ui/primitives/button';
import {
Dialog,
DialogContent,
DialogFooter,
DialogTrigger,
} from '@documenso/ui/primitives/dialog';
export type SignDialogProps = {
isSubmitting: boolean;
document: Document;
fields: Field[];
onSignatureComplete: () => void | Promise<void>;
};
export const SignDialog = ({
isSubmitting,
document,
fields,
onSignatureComplete,
}: SignDialogProps) => {
const [showDialog, setShowDialog] = useState(false);
const isComplete = fields.every((field) => field.inserted);
return (
<Dialog open={showDialog} onOpenChange={setShowDialog}>
<DialogTrigger asChild>
<Button
className="w-full"
type="button"
size="lg"
disabled={!isComplete}
loading={isSubmitting}
>
Complete
</Button>
</DialogTrigger>
<DialogContent>
<div className="text-center">
<div className="text-xl font-semibold text-neutral-800">Sign Document</div>
<div className="text-muted-foreground mx-auto w-4/5 py-2 text-center">
You are about to finish signing "{document.title}". Are you sure?
</div>
</div>
<DialogFooter>
<div className="flex w-full flex-1 flex-nowrap gap-4">
<Button
type="button"
className="dark:bg-muted dark:hover:bg-muted/80 flex-1 bg-black/5 hover:bg-black/10"
variant="secondary"
onClick={() => {
setShowDialog(false);
}}
>
Cancel
</Button>
<Button
type="button"
className="flex-1"
disabled={!isComplete}
loading={isSubmitting}
onClick={onSignatureComplete}
>
Sign
</Button>
</div>
</DialogFooter>
</DialogContent>
</Dialog>
);
};

View File

@@ -6,8 +6,8 @@ import { useRouter } from 'next/navigation';
import { Loader } from 'lucide-react';
import { Recipient } from '@documenso/prisma/client';
import { FieldWithSignature } from '@documenso/prisma/types/field-with-signature';
import type { Recipient } from '@documenso/prisma/client';
import type { FieldWithSignature } from '@documenso/prisma/types/field-with-signature';
import { trpc } from '@documenso/trpc/react';
import { Button } from '@documenso/ui/primitives/button';
import { Dialog, DialogContent, DialogFooter, DialogTitle } from '@documenso/ui/primitives/dialog';
@@ -121,7 +121,7 @@ export const SignatureField = ({ field, recipient }: SignatureFieldProps) => {
};
return (
<SigningFieldContainer field={field} onSign={onSign} onRemove={onRemove}>
<SigningFieldContainer field={field} onSign={onSign} onRemove={onRemove} type="Signature">
{isLoading && (
<div className="bg-background absolute inset-0 flex items-center justify-center rounded-md">
<Loader className="text-primary h-5 w-5 animate-spin md:h-8 md:w-8" />

View File

@@ -2,8 +2,9 @@
import React from 'react';
import { FieldWithSignature } from '@documenso/prisma/types/field-with-signature';
import type { FieldWithSignature } from '@documenso/prisma/types/field-with-signature';
import { FieldRootContainer } from '@documenso/ui/components/field/field';
import { Tooltip, TooltipContent, TooltipTrigger } from '@documenso/ui/primitives/tooltip';
export type SignatureFieldProps = {
field: FieldWithSignature;
@@ -11,6 +12,8 @@ export type SignatureFieldProps = {
children: React.ReactNode;
onSign?: () => Promise<void> | void;
onRemove?: () => Promise<void> | void;
type?: 'Date' | 'Email' | 'Name' | 'Signature';
tooltipText?: string | null;
};
export const SigningFieldContainer = ({
@@ -19,6 +22,8 @@ export const SigningFieldContainer = ({
onSign,
onRemove,
children,
type,
tooltipText,
}: SignatureFieldProps) => {
const onSignFieldClick = async () => {
if (field.inserted) {
@@ -46,7 +51,22 @@ export const SigningFieldContainer = ({
/>
)}
{field.inserted && !loading && (
{type === 'Date' && field.inserted && !loading && (
<Tooltip delayDuration={0}>
<TooltipTrigger asChild>
<button
className="text-destructive bg-background/40 absolute inset-0 z-10 flex h-full w-full items-center justify-center rounded-md text-sm opacity-0 backdrop-blur-sm duration-200 group-hover:opacity-100"
onClick={onRemoveSignedFieldClick}
>
Remove
</button>
</TooltipTrigger>
{tooltipText && <TooltipContent className="max-w-xs">{tooltipText}</TooltipContent>}
</Tooltip>
)}
{type !== 'Date' && field.inserted && !loading && (
<button
className="text-destructive bg-background/40 absolute inset-0 z-10 flex h-full w-full items-center justify-center rounded-md text-sm opacity-0 backdrop-blur-sm duration-200 group-hover:opacity-100"
onClick={onRemoveSignedFieldClick}

View File

@@ -0,0 +1,97 @@
import Link from 'next/link';
import { AlertTriangle, CheckCircle2, XCircle, XOctagon } from 'lucide-react';
import { verifyEmail } from '@documenso/lib/server-only/user/verify-email';
import { Button } from '@documenso/ui/primitives/button';
export type PageProps = {
params: {
token: string;
};
};
export default async function VerifyEmailPage({ params: { token } }: PageProps) {
if (!token) {
return (
<div className="w-full">
<div className="mb-4 text-red-300">
<XOctagon />
</div>
<h2 className="text-4xl font-semibold">No token provided</h2>
<p className="text-muted-foreground mt-2 text-base">
It seems that there is no token provided. Please check your email and try again.
</p>
</div>
);
}
const verified = await verifyEmail({ token });
if (verified === null) {
return (
<div className="flex w-full items-start">
<div className="mr-4 mt-1 hidden md:block">
<AlertTriangle className="h-10 w-10 text-yellow-500" strokeWidth={2} />
</div>
<div>
<h2 className="text-2xl font-bold md:text-4xl">Something went wrong</h2>
<p className="text-muted-foreground mt-4">
We were unable to verify your email. If your email is not verified already, please try
again.
</p>
<Button className="mt-4" asChild>
<Link href="/">Go back home</Link>
</Button>
</div>
</div>
);
}
if (!verified) {
return (
<div className="flex w-full items-start">
<div className="mr-4 mt-1 hidden md:block">
<XCircle className="text-destructive h-10 w-10" strokeWidth={2} />
</div>
<div>
<h2 className="text-2xl font-bold md:text-4xl">Your token has expired!</h2>
<p className="text-muted-foreground mt-4">
It seems that the provided token has expired. We've just sent you another token, please
check your email and try again.
</p>
<Button className="mt-4" asChild>
<Link href="/">Go back home</Link>
</Button>
</div>
</div>
);
}
return (
<div className="flex w-full items-start">
<div className="mr-4 mt-1 hidden md:block">
<CheckCircle2 className="h-10 w-10 text-green-500" strokeWidth={2} />
</div>
<div>
<h2 className="text-2xl font-bold md:text-4xl">Email Confirmed!</h2>
<p className="text-muted-foreground mt-4">
Your email has been successfully confirmed! You can now use all features of Documenso.
</p>
<Button className="mt-4" asChild>
<Link href="/">Go back home</Link>
</Button>
</div>
</div>
);
}

View File

@@ -0,0 +1,28 @@
import Link from 'next/link';
import { XCircle } from 'lucide-react';
import { Button } from '@documenso/ui/primitives/button';
export default function EmailVerificationWithoutTokenPage() {
return (
<div className="flex w-full items-start">
<div className="mr-4 mt-1 hidden md:block">
<XCircle className="text-destructive h-10 w-10" strokeWidth={2} />
</div>
<div>
<h2 className="text-2xl font-bold md:text-4xl">Uh oh! Looks like you're missing a token</h2>
<p className="text-muted-foreground mt-4">
It seems that there is no token provided, if you are trying to verify your email please
follow the link in your email.
</p>
<Button className="mt-4" asChild>
<Link href="/">Go back home</Link>
</Button>
</div>
</div>
);
}

View File

@@ -1,6 +1,6 @@
import Link from 'next/link';
import { getServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { getServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
import { Button } from '@documenso/ui/primitives/button';
import NotFoundPartial from '~/components/partials/not-found';

View File

@@ -40,61 +40,22 @@ const SETTINGS_PAGES = [
{ label: 'Password', path: '/settings/password' },
];
export type CommandMenuProps = {
open?: boolean;
onOpenChange?: (_open: boolean) => void;
};
export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {
export function CommandMenu() {
const { setTheme } = useTheme();
const router = useRouter();
const [isOpen, setIsOpen] = useState(() => open ?? false);
const { push } = useRouter();
const [open, setOpen] = useState(false);
const [search, setSearch] = useState('');
const [pages, setPages] = useState<string[]>([]);
const currentPage = pages[pages.length - 1];
const toggleOpen = () => {
setIsOpen((isOpen) => !isOpen);
onOpenChange?.(!isOpen);
if (isOpen) {
setPages([]);
setSearch('');
}
};
const setOpen = useCallback(
(open: boolean) => {
setIsOpen(open);
onOpenChange?.(open);
if (!open) {
setPages([]);
setSearch('');
}
},
[onOpenChange],
);
const push = useCallback(
(path: string) => {
router.push(path);
setOpen(false);
},
[router, setOpen],
);
const addPage = (page: string) => {
setPages((pages) => [...pages, page]);
setSearch('');
setOpen((open) => !open);
};
const goToSettings = useCallback(() => push(SETTINGS_PAGES[0].path), [push]);
const goToDocuments = useCallback(() => push(DOCUMENTS_PAGES[0].path), [push]);
useHotkeys(['ctrl+k', 'meta+k'], toggleOpen);
useHotkeys('ctrl+k', toggleOpen);
useHotkeys(SETTINGS_PAGE_SHORTCUT, goToSettings);
useHotkeys(DOCUMENTS_PAGE_SHORTCUT, goToDocuments);
@@ -103,11 +64,9 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {
// Backspace goes to previous page when search is empty
if (e.key === 'Escape' || (e.key === 'Backspace' && !search)) {
e.preventDefault();
if (currentPage === undefined) {
setOpen(false);
}
setPages((pages) => pages.slice(0, -1));
}
};
@@ -119,7 +78,6 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {
onValueChange={setSearch}
placeholder="Type a command or search..."
/>
<CommandList>
<CommandEmpty>No results found.</CommandEmpty>
{!currentPage && (
@@ -131,7 +89,7 @@ export function CommandMenu({ open, onOpenChange }: CommandMenuProps) {
<Commands push={push} pages={SETTINGS_PAGES} />
</CommandGroup>
<CommandGroup heading="Preferences">
<CommandItem onSelect={() => addPage('theme')}>Change theme</CommandItem>
<CommandItem onSelect={() => setPages([...pages, 'theme'])}>Change theme</CommandItem>
</CommandGroup>
</>
)}

View File

@@ -1,44 +1,16 @@
'use client';
import { HTMLAttributes, useState } from 'react';
import { Search } from 'lucide-react';
import { HTMLAttributes } from 'react';
import { cn } from '@documenso/ui/lib/utils';
import { Button } from '@documenso/ui/primitives/button';
import { CommandMenu } from '../common/command-menu';
export type DesktopNavProps = HTMLAttributes<HTMLDivElement>;
export const DesktopNav = ({ className, ...props }: DesktopNavProps) => {
// const pathname = usePathname();
const [open, setOpen] = useState(false);
return (
<div
className={cn('ml-8 hidden flex-1 gap-x-6 md:flex md:justify-center', className)}
{...props}
>
<CommandMenu open={open} onOpenChange={setOpen} />
<Button
variant="outline"
className="text-muted-foreground flex w-96 items-center justify-between rounded-lg"
onClick={() => setOpen((open) => !open)}
>
<div className="flex items-center">
<Search className="mr-2 h-5 w-5" />
Search
</div>
<div>
<div className="text-muted-foreground bg-muted rounded-md px-1.5 py-0.5 font-mono text-xs">
Ctrl+K
</div>
</div>
</Button>
<div className={cn('ml-8 hidden flex-1 gap-x-6 md:flex', className)} {...props}>
{/* We have no other subpaths rn */}
{/* <Link
href="/documents"

View File

@@ -4,7 +4,7 @@ import Link from 'next/link';
import {
CreditCard,
Key,
Lock,
LogOut,
User as LucideUser,
Monitor,
@@ -87,9 +87,9 @@ export const ProfileDropdown = ({ user }: ProfileDropdownProps) => {
</DropdownMenuItem>
<DropdownMenuItem asChild>
<Link href="/settings/password" className="cursor-pointer">
<Key className="mr-2 h-4 w-4" />
Password
<Link href="/settings/security" className="cursor-pointer">
<Lock className="mr-2 h-4 w-4" />
Security
</Link>
</DropdownMenuItem>

View File

@@ -0,0 +1,123 @@
'use client';
import { useEffect, useState } from 'react';
import { AlertTriangle } from 'lucide-react';
import { ONE_SECOND } from '@documenso/lib/constants/time';
import { trpc } from '@documenso/trpc/react';
import { Button } from '@documenso/ui/primitives/button';
import {
Dialog,
DialogContent,
DialogDescription,
DialogTitle,
} from '@documenso/ui/primitives/dialog';
import { useToast } from '@documenso/ui/primitives/use-toast';
export type VerifyEmailBannerProps = {
email: string;
};
const RESEND_CONFIRMATION_EMAIL_TIMEOUT = 20 * ONE_SECOND;
export const VerifyEmailBanner = ({ email }: VerifyEmailBannerProps) => {
const { toast } = useToast();
const [isOpen, setIsOpen] = useState(false);
const [isButtonDisabled, setIsButtonDisabled] = useState(false);
const { mutateAsync: sendConfirmationEmail, isLoading } =
trpc.profile.sendConfirmationEmail.useMutation();
const onResendConfirmationEmail = async () => {
try {
setIsButtonDisabled(true);
await sendConfirmationEmail({ email: email });
toast({
title: 'Success',
description: 'Verification email sent successfully.',
});
setIsOpen(false);
setTimeout(() => setIsButtonDisabled(false), RESEND_CONFIRMATION_EMAIL_TIMEOUT);
} catch (err) {
setIsButtonDisabled(false);
toast({
title: 'Error',
description: 'Something went wrong while sending the confirmation email.',
variant: 'destructive',
});
}
};
useEffect(() => {
// Check localStorage to see if we've recently automatically displayed the dialog
// if it was within the past 24 hours, don't show it again
// otherwise, show it again and update the localStorage timestamp
const emailVerificationDialogLastShown = localStorage.getItem(
'emailVerificationDialogLastShown',
);
if (emailVerificationDialogLastShown) {
const lastShownTimestamp = parseInt(emailVerificationDialogLastShown);
if (Date.now() - lastShownTimestamp < 24 * 60 * 60 * 1000) {
return;
}
}
setIsOpen(true);
localStorage.setItem('emailVerificationDialogLastShown', Date.now().toString());
}, []);
return (
<>
<div className="bg-yellow-200 dark:bg-yellow-400">
<div className="mx-auto flex max-w-screen-xl items-center justify-center gap-x-4 px-4 py-2 text-sm font-medium text-yellow-900">
<div className="flex items-center">
<AlertTriangle className="mr-2.5 h-5 w-5" />
Verify your email address to unlock all features.
</div>
<div>
<Button
variant="ghost"
className="h-auto px-2.5 py-1.5 text-yellow-900 hover:bg-yellow-100 hover:text-yellow-900 dark:hover:bg-yellow-500"
disabled={isButtonDisabled}
onClick={() => setIsOpen(true)}
size="sm"
>
{isButtonDisabled ? 'Verification Email Sent' : 'Verify Now'}
</Button>
</div>
</div>
</div>
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<DialogContent>
<DialogTitle>Verify your email address</DialogTitle>
<DialogDescription>
We've sent a confirmation email to <strong>{email}</strong>. Please check your inbox and
click the link in the email to verify your account.
</DialogDescription>
<div>
<Button
disabled={isButtonDisabled}
loading={isLoading}
onClick={onResendConfirmationEmail}
>
{isLoading ? 'Sending...' : 'Resend Confirmation Email'}
</Button>
</div>
</DialogContent>
</Dialog>
</>
);
};

View File

@@ -5,7 +5,7 @@ import { HTMLAttributes } from 'react';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { CreditCard, Key, User } from 'lucide-react';
import { CreditCard, Lock, User } from 'lucide-react';
import { useFeatureFlags } from '@documenso/lib/client-only/providers/feature-flag';
import { cn } from '@documenso/ui/lib/utils';
@@ -35,16 +35,16 @@ export const DesktopNav = ({ className, ...props }: DesktopNavProps) => {
</Button>
</Link>
<Link href="/settings/password">
<Link href="/settings/security">
<Button
variant="ghost"
className={cn(
'w-full justify-start',
pathname?.startsWith('/settings/password') && 'bg-secondary',
pathname?.startsWith('/settings/security') && 'bg-secondary',
)}
>
<Key className="mr-2 h-5 w-5" />
Password
<Lock className="mr-2 h-5 w-5" />
Security
</Button>
</Link>

View File

@@ -5,7 +5,7 @@ import { HTMLAttributes } from 'react';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { CreditCard, Key, User } from 'lucide-react';
import { CreditCard, Lock, User } from 'lucide-react';
import { useFeatureFlags } from '@documenso/lib/client-only/providers/feature-flag';
import { cn } from '@documenso/ui/lib/utils';
@@ -38,16 +38,16 @@ export const MobileNav = ({ className, ...props }: MobileNavProps) => {
</Button>
</Link>
<Link href="/settings/password">
<Link href="/settings/security">
<Button
variant="ghost"
className={cn(
'w-full justify-start',
pathname?.startsWith('/settings/password') && 'bg-secondary',
pathname?.startsWith('/settings/security') && 'bg-secondary',
)}
>
<Key className="mr-2 h-5 w-5" />
Password
<Lock className="mr-2 h-5 w-5" />
Security
</Button>
</Link>

View File

@@ -1,9 +1,9 @@
import { HTMLAttributes } from 'react';
import type { HTMLAttributes } from 'react';
import { CheckCircle2, Clock, File } from 'lucide-react';
import type { LucideIcon } from 'lucide-react/dist/lucide-react';
import { ExtendedDocumentStatus } from '@documenso/prisma/types/extended-document-status';
import type { ExtendedDocumentStatus } from '@documenso/prisma/types/extended-document-status';
import { SignatureIcon } from '@documenso/ui/icons/signature';
import { cn } from '@documenso/ui/lib/utils';

View File

@@ -1,8 +1,10 @@
'use client';
import { HTMLAttributes, useEffect, useState } from 'react';
import type { HTMLAttributes } from 'react';
import { useEffect, useState } from 'react';
import { DateTime, DateTimeFormatOptions } from 'luxon';
import type { DateTimeFormatOptions } from 'luxon';
import { DateTime } from 'luxon';
import { useLocale } from '@documenso/lib/client-only/providers/locale';

View File

@@ -0,0 +1,58 @@
'use client';
import { useState } from 'react';
import { Button } from '@documenso/ui/primitives/button';
import { DisableAuthenticatorAppDialog } from './disable-authenticator-app-dialog';
import { EnableAuthenticatorAppDialog } from './enable-authenticator-app-dialog';
type AuthenticatorAppProps = {
isTwoFactorEnabled: boolean;
};
export const AuthenticatorApp = ({ isTwoFactorEnabled }: AuthenticatorAppProps) => {
const [modalState, setModalState] = useState<'enable' | 'disable' | null>(null);
const isEnableDialogOpen = modalState === 'enable';
const isDisableDialogOpen = modalState === 'disable';
return (
<>
<div className="mt-4 flex flex-col justify-between gap-4 rounded-lg border p-4 md:flex-row md:items-center md:gap-8">
<div className="flex-1">
<p>Authenticator app</p>
<p className="text-muted-foreground mt-2 max-w-[50ch] text-sm">
Create one-time passwords that serve as a secondary authentication method for confirming
your identity when requested during the sign-in process.
</p>
</div>
<div>
{isTwoFactorEnabled ? (
<Button variant="destructive" onClick={() => setModalState('disable')} size="sm">
Disable 2FA
</Button>
) : (
<Button onClick={() => setModalState('enable')} size="sm">
Enable 2FA
</Button>
)}
</div>
</div>
<EnableAuthenticatorAppDialog
key={isEnableDialogOpen ? 'open' : 'closed'}
open={isEnableDialogOpen}
onOpenChange={(open) => !open && setModalState(null)}
/>
<DisableAuthenticatorAppDialog
key={isDisableDialogOpen ? 'open' : 'closed'}
open={isDisableDialogOpen}
onOpenChange={(open) => !open && setModalState(null)}
/>
</>
);
};

View File

@@ -0,0 +1,161 @@
import { useRouter } from 'next/navigation';
import { zodResolver } from '@hookform/resolvers/zod';
import { flushSync } from 'react-dom';
import { useForm } from 'react-hook-form';
import { z } from 'zod';
import { trpc } from '@documenso/trpc/react';
import { Button } from '@documenso/ui/primitives/button';
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
} from '@documenso/ui/primitives/dialog';
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from '@documenso/ui/primitives/form/form';
import { Input } from '@documenso/ui/primitives/input';
import { useToast } from '@documenso/ui/primitives/use-toast';
export const ZDisableTwoFactorAuthenticationForm = z.object({
password: z.string().min(6).max(72),
backupCode: z.string(),
});
export type TDisableTwoFactorAuthenticationForm = z.infer<
typeof ZDisableTwoFactorAuthenticationForm
>;
export type DisableAuthenticatorAppDialogProps = {
open: boolean;
onOpenChange: (_open: boolean) => void;
};
export const DisableAuthenticatorAppDialog = ({
open,
onOpenChange,
}: DisableAuthenticatorAppDialogProps) => {
const router = useRouter();
const { toast } = useToast();
const { mutateAsync: disableTwoFactorAuthentication } =
trpc.twoFactorAuthentication.disable.useMutation();
const disableTwoFactorAuthenticationForm = useForm<TDisableTwoFactorAuthenticationForm>({
defaultValues: {
password: '',
backupCode: '',
},
resolver: zodResolver(ZDisableTwoFactorAuthenticationForm),
});
const { isSubmitting: isDisableTwoFactorAuthenticationSubmitting } =
disableTwoFactorAuthenticationForm.formState;
const onDisableTwoFactorAuthenticationFormSubmit = async ({
password,
backupCode,
}: TDisableTwoFactorAuthenticationForm) => {
try {
await disableTwoFactorAuthentication({ password, backupCode });
toast({
title: 'Two-factor authentication disabled',
description:
'Two-factor authentication has been disabled for your account. You will no longer be required to enter a code from your authenticator app when signing in.',
});
flushSync(() => {
onOpenChange(false);
});
router.refresh();
} catch (_err) {
toast({
title: 'Unable to disable two-factor authentication',
description:
'We were unable to disable two-factor authentication for your account. Please ensure that you have entered your password and backup code correctly and try again.',
variant: 'destructive',
});
}
};
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="w-full max-w-xl md:max-w-xl lg:max-w-xl">
<DialogHeader>
<DialogTitle>Disable Authenticator App</DialogTitle>
<DialogDescription>
To disable the Authenticator App for your account, please enter your password and a
backup code. If you do not have a backup code available, please contact support.
</DialogDescription>
</DialogHeader>
<Form {...disableTwoFactorAuthenticationForm}>
<form
onSubmit={disableTwoFactorAuthenticationForm.handleSubmit(
onDisableTwoFactorAuthenticationFormSubmit,
)}
className="flex flex-col gap-y-4"
>
<FormField
name="password"
control={disableTwoFactorAuthenticationForm.control}
render={({ field }) => (
<FormItem>
<FormLabel className="text-muted-foreground">Password</FormLabel>
<FormControl>
<Input
{...field}
type="password"
autoComplete="current-password"
value={field.value ?? ''}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<FormField
name="backupCode"
control={disableTwoFactorAuthenticationForm.control}
render={({ field }) => (
<FormItem>
<FormLabel className="text-muted-foreground">Backup Code</FormLabel>
<FormControl>
<Input {...field} type="text" value={field.value ?? ''} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<div className="flex w-full items-center justify-between">
<Button type="button" variant="ghost" onClick={() => onOpenChange(false)}>
Cancel
</Button>
<Button
type="submit"
variant="destructive"
loading={isDisableTwoFactorAuthenticationSubmitting}
>
Disable 2FA
</Button>
</div>
</form>
</Form>
</DialogContent>
</Dialog>
);
};

View File

@@ -0,0 +1,283 @@
import { useMemo } from 'react';
import { useRouter } from 'next/navigation';
import { zodResolver } from '@hookform/resolvers/zod';
import { flushSync } from 'react-dom';
import { useForm } from 'react-hook-form';
import { match } from 'ts-pattern';
import { renderSVG } from 'uqr';
import { z } from 'zod';
import { trpc } from '@documenso/trpc/react';
import { Button } from '@documenso/ui/primitives/button';
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
} from '@documenso/ui/primitives/dialog';
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from '@documenso/ui/primitives/form/form';
import { Input } from '@documenso/ui/primitives/input';
import { useToast } from '@documenso/ui/primitives/use-toast';
import { RecoveryCodeList } from './recovery-code-list';
export const ZSetupTwoFactorAuthenticationForm = z.object({
password: z.string().min(6).max(72),
});
export type TSetupTwoFactorAuthenticationForm = z.infer<typeof ZSetupTwoFactorAuthenticationForm>;
export const ZEnableTwoFactorAuthenticationForm = z.object({
token: z.string(),
});
export type TEnableTwoFactorAuthenticationForm = z.infer<typeof ZEnableTwoFactorAuthenticationForm>;
export type EnableAuthenticatorAppDialogProps = {
open: boolean;
onOpenChange: (_open: boolean) => void;
};
export const EnableAuthenticatorAppDialog = ({
open,
onOpenChange,
}: EnableAuthenticatorAppDialogProps) => {
const router = useRouter();
const { toast } = useToast();
const { mutateAsync: setupTwoFactorAuthentication, data: setupTwoFactorAuthenticationData } =
trpc.twoFactorAuthentication.setup.useMutation();
const { mutateAsync: enableTwoFactorAuthentication, data: enableTwoFactorAuthenticationData } =
trpc.twoFactorAuthentication.enable.useMutation();
const setupTwoFactorAuthenticationForm = useForm<TSetupTwoFactorAuthenticationForm>({
defaultValues: {
password: '',
},
resolver: zodResolver(ZSetupTwoFactorAuthenticationForm),
});
const { isSubmitting: isSetupTwoFactorAuthenticationSubmitting } =
setupTwoFactorAuthenticationForm.formState;
const enableTwoFactorAuthenticationForm = useForm<TEnableTwoFactorAuthenticationForm>({
defaultValues: {
token: '',
},
resolver: zodResolver(ZEnableTwoFactorAuthenticationForm),
});
const { isSubmitting: isEnableTwoFactorAuthenticationSubmitting } =
enableTwoFactorAuthenticationForm.formState;
const step = useMemo(() => {
if (!setupTwoFactorAuthenticationData || isSetupTwoFactorAuthenticationSubmitting) {
return 'setup';
}
if (!enableTwoFactorAuthenticationData || isEnableTwoFactorAuthenticationSubmitting) {
return 'enable';
}
return 'view';
}, [
setupTwoFactorAuthenticationData,
isSetupTwoFactorAuthenticationSubmitting,
enableTwoFactorAuthenticationData,
isEnableTwoFactorAuthenticationSubmitting,
]);
const onSetupTwoFactorAuthenticationFormSubmit = async ({
password,
}: TSetupTwoFactorAuthenticationForm) => {
try {
await setupTwoFactorAuthentication({ password });
} catch (_err) {
toast({
title: 'Unable to setup two-factor authentication',
description:
'We were unable to setup two-factor authentication for your account. Please ensure that you have entered your password correctly and try again.',
variant: 'destructive',
});
}
};
const onEnableTwoFactorAuthenticationFormSubmit = async ({
token,
}: TEnableTwoFactorAuthenticationForm) => {
try {
await enableTwoFactorAuthentication({ code: token });
toast({
title: 'Two-factor authentication enabled',
description:
'Two-factor authentication has been enabled for your account. You will now be required to enter a code from your authenticator app when signing in.',
});
} catch (_err) {
toast({
title: 'Unable to setup two-factor authentication',
description:
'We were unable to setup two-factor authentication for your account. Please ensure that you have entered your password correctly and try again.',
variant: 'destructive',
});
}
};
const onCompleteClick = () => {
flushSync(() => {
onOpenChange(false);
});
router.refresh();
};
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="w-full max-w-xl md:max-w-xl lg:max-w-xl">
<DialogHeader>
<DialogTitle>Enable Authenticator App</DialogTitle>
{step === 'setup' && (
<DialogDescription>
To enable two-factor authentication, please enter your password below.
</DialogDescription>
)}
{step === 'view' && (
<DialogDescription>
Your recovery codes are listed below. Please store them in a safe place.
</DialogDescription>
)}
</DialogHeader>
{match(step)
.with('setup', () => {
return (
<Form {...setupTwoFactorAuthenticationForm}>
<form
onSubmit={setupTwoFactorAuthenticationForm.handleSubmit(
onSetupTwoFactorAuthenticationFormSubmit,
)}
className="flex flex-col gap-y-4"
>
<FormField
name="password"
control={setupTwoFactorAuthenticationForm.control}
render={({ field }) => (
<FormItem>
<FormLabel className="text-muted-foreground">Password</FormLabel>
<FormControl>
<Input
{...field}
type="password"
autoComplete="current-password"
value={field.value ?? ''}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<div className="flex w-full items-center justify-between">
<Button type="button" variant="ghost" onClick={() => onOpenChange(false)}>
Cancel
</Button>
<Button type="submit" loading={isSetupTwoFactorAuthenticationSubmitting}>
Continue
</Button>
</div>
</form>
</Form>
);
})
.with('enable', () => (
<Form {...enableTwoFactorAuthenticationForm}>
<form
onSubmit={enableTwoFactorAuthenticationForm.handleSubmit(
onEnableTwoFactorAuthenticationFormSubmit,
)}
className="flex flex-col gap-y-4"
>
<p className="text-muted-foreground text-sm">
To enable two-factor authentication, scan the following QR code using your
authenticator app.
</p>
<div
className="flex h-36 justify-center"
dangerouslySetInnerHTML={{
__html: renderSVG(setupTwoFactorAuthenticationData?.uri ?? ''),
}}
/>
<p className="text-muted-foreground text-sm">
If your authenticator app does not support QR codes, you can use the following
code instead:
</p>
<p className="bg-muted/60 text-muted-foreground rounded-lg p-2 text-center font-mono tracking-widest">
{setupTwoFactorAuthenticationData?.secret}
</p>
<p className="text-muted-foreground text-sm">
Once you have scanned the QR code or entered the code manually, enter the code
provided by your authenticator app below.
</p>
<FormField
name="token"
control={enableTwoFactorAuthenticationForm.control}
render={({ field }) => (
<FormItem>
<FormLabel className="text-muted-foreground">Token</FormLabel>
<FormControl>
<Input {...field} type="text" value={field.value ?? ''} />
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<div className="flex w-full items-center justify-between">
<Button type="button" variant="ghost" onClick={() => onOpenChange(false)}>
Cancel
</Button>
<Button type="submit" loading={isEnableTwoFactorAuthenticationSubmitting}>
Enable 2FA
</Button>
</div>
</form>
</Form>
))
.with('view', () => (
<div>
{enableTwoFactorAuthenticationData?.recoveryCodes && (
<RecoveryCodeList recoveryCodes={enableTwoFactorAuthenticationData.recoveryCodes} />
)}
<div className="mt-4 flex w-full flex-row-reverse items-center justify-between">
<Button type="button" onClick={() => onCompleteClick()}>
Complete
</Button>
</div>
</div>
))
.exhaustive()}
</DialogContent>
</Dialog>
);
};

View File

@@ -0,0 +1,57 @@
import { Copy } from 'lucide-react';
import { useCopyToClipboard } from '@documenso/lib/client-only/hooks/use-copy-to-clipboard';
import { useToast } from '@documenso/ui/primitives/use-toast';
export type RecoveryCodeListProps = {
recoveryCodes: string[];
};
export const RecoveryCodeList = ({ recoveryCodes }: RecoveryCodeListProps) => {
const { toast } = useToast();
const [, copyToClipboard] = useCopyToClipboard();
const onCopyRecoveryCodeClick = async (code: string) => {
try {
const result = await copyToClipboard(code);
if (!result) {
throw new Error('Unable to copy recovery code');
}
toast({
title: 'Recovery code copied',
description: 'Your recovery code has been copied to your clipboard.',
});
} catch (_err) {
toast({
title: 'Unable to copy recovery code',
description:
'We were unable to copy your recovery code to your clipboard. Please try again.',
variant: 'destructive',
});
}
};
return (
<div className="grid grid-cols-2 gap-4">
{recoveryCodes.map((code) => (
<div
key={code}
className="bg-muted text-muted-foreground relative rounded-lg p-4 font-mono md:text-center"
>
<span>{code}</span>
<div className="absolute inset-y-0 right-4 flex items-center justify-center">
<button
className="opacity-60 hover:opacity-80"
onClick={() => void onCopyRecoveryCodeClick(code)}
>
<Copy className="h-5 w-5" />
</button>
</div>
</div>
))}
</div>
);
};

View File

@@ -0,0 +1,43 @@
'use client';
import { useState } from 'react';
import { Button } from '@documenso/ui/primitives/button';
import { ViewRecoveryCodesDialog } from './view-recovery-codes-dialog';
type RecoveryCodesProps = {
// backupCodes: string[] | null;
isTwoFactorEnabled: boolean;
};
export const RecoveryCodes = ({ isTwoFactorEnabled }: RecoveryCodesProps) => {
const [isOpen, setIsOpen] = useState(false);
return (
<>
<div className="mt-4 flex flex-col justify-between gap-4 rounded-lg border p-4 md:flex-row md:items-center md:gap-8">
<div className="flex-1">
<p>Recovery Codes</p>
<p className="text-muted-foreground mt-2 max-w-[50ch] text-sm">
Recovery codes are used to access your account in the event that you lose access to your
authenticator app.
</p>
</div>
<div>
<Button onClick={() => setIsOpen(true)} disabled={!isTwoFactorEnabled} size="sm">
View Codes
</Button>
</div>
</div>
<ViewRecoveryCodesDialog
key={isOpen ? 'open' : 'closed'}
open={isOpen}
onOpenChange={setIsOpen}
/>
</>
);
};

View File

@@ -0,0 +1,151 @@
import { useMemo } from 'react';
import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import { match } from 'ts-pattern';
import { z } from 'zod';
import { trpc } from '@documenso/trpc/react';
import { Button } from '@documenso/ui/primitives/button';
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
} from '@documenso/ui/primitives/dialog';
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage,
} from '@documenso/ui/primitives/form/form';
import { Input } from '@documenso/ui/primitives/input';
import { useToast } from '@documenso/ui/primitives/use-toast';
import { RecoveryCodeList } from './recovery-code-list';
export const ZViewRecoveryCodesForm = z.object({
password: z.string().min(6).max(72),
});
export type TViewRecoveryCodesForm = z.infer<typeof ZViewRecoveryCodesForm>;
export type ViewRecoveryCodesDialogProps = {
open: boolean;
onOpenChange: (_open: boolean) => void;
};
export const ViewRecoveryCodesDialog = ({ open, onOpenChange }: ViewRecoveryCodesDialogProps) => {
const { toast } = useToast();
const { mutateAsync: viewRecoveryCodes, data: viewRecoveryCodesData } =
trpc.twoFactorAuthentication.viewRecoveryCodes.useMutation();
const viewRecoveryCodesForm = useForm<TViewRecoveryCodesForm>({
defaultValues: {
password: '',
},
resolver: zodResolver(ZViewRecoveryCodesForm),
});
const { isSubmitting: isViewRecoveryCodesSubmitting } = viewRecoveryCodesForm.formState;
const step = useMemo(() => {
if (!viewRecoveryCodesData || isViewRecoveryCodesSubmitting) {
return 'authenticate';
}
return 'view';
}, [viewRecoveryCodesData, isViewRecoveryCodesSubmitting]);
const onViewRecoveryCodesFormSubmit = async ({ password }: TViewRecoveryCodesForm) => {
try {
await viewRecoveryCodes({ password });
} catch (_err) {
toast({
title: 'Unable to view recovery codes',
description:
'We were unable to view your recovery codes. Please ensure that you have entered your password correctly and try again.',
variant: 'destructive',
});
}
};
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="w-full max-w-xl md:max-w-xl lg:max-w-xl">
<DialogHeader>
<DialogTitle>View Recovery Codes</DialogTitle>
{step === 'authenticate' && (
<DialogDescription>
To view your recovery codes, please enter your password below.
</DialogDescription>
)}
{step === 'view' && (
<DialogDescription>
Your recovery codes are listed below. Please store them in a safe place.
</DialogDescription>
)}
</DialogHeader>
{match(step)
.with('authenticate', () => {
return (
<Form {...viewRecoveryCodesForm}>
<form
onSubmit={viewRecoveryCodesForm.handleSubmit(onViewRecoveryCodesFormSubmit)}
className="flex flex-col gap-y-4"
>
<FormField
name="password"
control={viewRecoveryCodesForm.control}
render={({ field }) => (
<FormItem>
<FormLabel className="text-muted-foreground">Password</FormLabel>
<FormControl>
<Input
{...field}
type="password"
autoComplete="current-password"
value={field.value ?? ''}
/>
</FormControl>
<FormMessage />
</FormItem>
)}
/>
<div className="flex w-full items-center justify-between">
<Button type="button" variant="ghost" onClick={() => onOpenChange(false)}>
Cancel
</Button>
<Button type="submit" loading={isViewRecoveryCodesSubmitting}>
Continue
</Button>
</div>
</form>
</Form>
);
})
.with('view', () => (
<div>
{viewRecoveryCodesData?.recoveryCodes && (
<RecoveryCodeList recoveryCodes={viewRecoveryCodesData.recoveryCodes} />
)}
<div className="mt-4 flex flex-row-reverse items-center justify-between">
<Button onClick={() => onOpenChange(false)}>Complete</Button>
</div>
</div>
))
.exhaustive()}
</DialogContent>
</Dialog>
);
};

View File

@@ -1,8 +1,8 @@
'use server';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
import { setFieldsForDocument } from '@documenso/lib/server-only/field/set-fields-for-document';
import { TAddFieldsFormSchema } from '@documenso/ui/primitives/document-flow/add-fields.types';
import type { TAddFieldsFormSchema } from '@documenso/ui/primitives/document-flow/add-fields.types';
export type AddFieldsActionInput = TAddFieldsFormSchema & {
documentId: number;

View File

@@ -1,8 +1,8 @@
'use server';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
import { setRecipientsForDocument } from '@documenso/lib/server-only/recipient/set-recipients-for-document';
import { TAddSignersFormSchema } from '@documenso/ui/primitives/document-flow/add-signers.types';
import type { TAddSignersFormSchema } from '@documenso/ui/primitives/document-flow/add-signers.types';
export type AddSignersActionInput = TAddSignersFormSchema & {
documentId: number;

View File

@@ -1,24 +1,26 @@
'use server';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-session';
import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session';
import { upsertDocumentMeta } from '@documenso/lib/server-only/document-meta/upsert-document-meta';
import { sendDocument } from '@documenso/lib/server-only/document/send-document';
import { TAddSubjectFormSchema } from '@documenso/ui/primitives/document-flow/add-subject.types';
import type { TAddSubjectFormSchema } from '@documenso/ui/primitives/document-flow/add-subject.types';
export type CompleteDocumentActionInput = TAddSubjectFormSchema & {
documentId: number;
};
export const completeDocument = async ({ documentId, email }: CompleteDocumentActionInput) => {
export const completeDocument = async ({ documentId, meta }: CompleteDocumentActionInput) => {
'use server';
const { user } = await getRequiredServerComponentSession();
if (email.message || email.subject) {
if (meta.message || meta.subject || meta.dateFormat || meta.timezone) {
await upsertDocumentMeta({
documentId,
subject: email.subject,
message: email.message,
subject: meta.subject,
message: meta.message,
timezone: meta.timezone,
dateFormat: meta.dateFormat,
});
}

View File

@@ -10,6 +10,7 @@ import { z } from 'zod';
import { User } from '@documenso/prisma/client';
import { TRPCClientError } from '@documenso/trpc/client';
import { trpc } from '@documenso/trpc/react';
import { ZCurrentPasswordSchema, ZPasswordSchema } from '@documenso/trpc/server/auth-router/schema';
import { cn } from '@documenso/ui/lib/utils';
import { Button } from '@documenso/ui/primitives/button';
import { Input } from '@documenso/ui/primitives/input';
@@ -20,9 +21,9 @@ import { FormErrorMessage } from '../form/form-error-message';
export const ZPasswordFormSchema = z
.object({
currentPassword: z.string().min(6).max(72),
password: z.string().min(6).max(72),
repeatedPassword: z.string().min(6).max(72),
currentPassword: ZCurrentPasswordSchema,
password: ZPasswordSchema,
repeatedPassword: ZPasswordSchema,
})
.refine((data) => data.password === data.repeatedPassword, {
message: 'Passwords do not match',

View File

@@ -11,6 +11,7 @@ import { z } from 'zod';
import { TRPCClientError } from '@documenso/trpc/client';
import { trpc } from '@documenso/trpc/react';
import { ZPasswordSchema } from '@documenso/trpc/server/auth-router/schema';
import { cn } from '@documenso/ui/lib/utils';
import { Button } from '@documenso/ui/primitives/button';
import { FormErrorMessage } from '@documenso/ui/primitives/form/form-error-message';
@@ -20,8 +21,8 @@ import { useToast } from '@documenso/ui/primitives/use-toast';
export const ZResetPasswordFormSchema = z
.object({
password: z.string().min(6).max(72),
repeatedPassword: z.string().min(6).max(72),
password: ZPasswordSchema,
repeatedPassword: ZPasswordSchema,
})
.refine((data) => data.password === data.repeatedPassword, {
path: ['repeatedPassword'],

View File

@@ -3,32 +3,39 @@
import { useState } from 'react';
import { zodResolver } from '@hookform/resolvers/zod';
import { Eye, EyeOff } from 'lucide-react';
import { signIn } from 'next-auth/react';
import { useForm } from 'react-hook-form';
import { FcGoogle } from 'react-icons/fc';
import { z } from 'zod';
import { ErrorCode, isErrorCode } from '@documenso/lib/next-auth/error-codes';
import { ZCurrentPasswordSchema } from '@documenso/trpc/server/auth-router/schema';
import { cn } from '@documenso/ui/lib/utils';
import { Button } from '@documenso/ui/primitives/button';
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@documenso/ui/primitives/dialog';
import { FormErrorMessage } from '@documenso/ui/primitives/form/form-error-message';
import { Input } from '@documenso/ui/primitives/input';
import { Input, PasswordInput } from '@documenso/ui/primitives/input';
import { Label } from '@documenso/ui/primitives/label';
import { useToast } from '@documenso/ui/primitives/use-toast';
const ERROR_MESSAGES = {
const ERROR_MESSAGES: Partial<Record<keyof typeof ErrorCode, string>> = {
[ErrorCode.CREDENTIALS_NOT_FOUND]: 'The email or password provided is incorrect',
[ErrorCode.INCORRECT_EMAIL_PASSWORD]: 'The email or password provided is incorrect',
[ErrorCode.USER_MISSING_PASSWORD]:
'This account appears to be using a social login method, please sign in using that method',
[ErrorCode.INCORRECT_TWO_FACTOR_CODE]: 'The two-factor authentication code provided is incorrect',
[ErrorCode.INCORRECT_TWO_FACTOR_BACKUP_CODE]: 'The backup code provided is incorrect',
};
const TwoFactorEnabledErrorCode = ErrorCode.TWO_FACTOR_MISSING_CREDENTIALS;
const LOGIN_REDIRECT_PATH = '/documents';
export const ZSignInFormSchema = z.object({
email: z.string().email().min(1),
password: z.string().min(6).max(72),
password: ZCurrentPasswordSchema,
totpCode: z.string().trim().optional(),
backupCode: z.string().trim().optional(),
});
export type TSignInFormSchema = z.infer<typeof ZSignInFormSchema>;
@@ -39,33 +46,84 @@ export type SignInFormProps = {
export const SignInForm = ({ className }: SignInFormProps) => {
const { toast } = useToast();
const [showPassword, setShowPassword] = useState(false);
const [isTwoFactorAuthenticationDialogOpen, setIsTwoFactorAuthenticationDialogOpen] =
useState(false);
const [twoFactorAuthenticationMethod, setTwoFactorAuthenticationMethod] = useState<
'totp' | 'backup'
>('totp');
const {
register,
handleSubmit,
setValue,
formState: { errors, isSubmitting },
} = useForm<TSignInFormSchema>({
values: {
email: '',
password: '',
totpCode: '',
backupCode: '',
},
resolver: zodResolver(ZSignInFormSchema),
});
const onFormSubmit = async ({ email, password }: TSignInFormSchema) => {
const onCloseTwoFactorAuthenticationDialog = () => {
setValue('totpCode', '');
setValue('backupCode', '');
setIsTwoFactorAuthenticationDialogOpen(false);
};
const onToggleTwoFactorAuthenticationMethodClick = () => {
const method = twoFactorAuthenticationMethod === 'totp' ? 'backup' : 'totp';
if (method === 'totp') {
setValue('backupCode', '');
}
if (method === 'backup') {
setValue('totpCode', '');
}
setTwoFactorAuthenticationMethod(method);
};
const onFormSubmit = async ({ email, password, totpCode, backupCode }: TSignInFormSchema) => {
try {
const result = await signIn('credentials', {
const credentials: Record<string, string> = {
email,
password,
};
if (totpCode) {
credentials.totpCode = totpCode;
}
if (backupCode) {
credentials.backupCode = backupCode;
}
const result = await signIn('credentials', {
...credentials,
callbackUrl: LOGIN_REDIRECT_PATH,
redirect: false,
});
if (result?.error && isErrorCode(result.error)) {
if (result.error === TwoFactorEnabledErrorCode) {
setIsTwoFactorAuthenticationDialogOpen(true);
return;
}
const errorMessage = ERROR_MESSAGES[result.error];
toast({
variant: 'destructive',
description: ERROR_MESSAGES[result.error],
title: 'Unable to sign in',
description: errorMessage ?? 'An unknown error occurred',
});
return;
@@ -118,31 +176,14 @@ export const SignInForm = ({ className }: SignInFormProps) => {
<span>Password</span>
</Label>
<div className="relative">
<Input
id="password"
type={showPassword ? 'text' : 'password'}
minLength={6}
maxLength={72}
autoComplete="current-password"
className="bg-background mt-2 pr-10"
{...register('password')}
/>
<Button
variant="link"
type="button"
className="absolute right-0 top-0 flex h-full items-center justify-center pr-3"
aria-label={showPassword ? 'Mask password' : 'Reveal password'}
onClick={() => setShowPassword((show) => !show)}
>
{showPassword ? (
<EyeOff className="text-muted-foreground h-5 w-5" />
) : (
<Eye className="text-muted-foreground h-5 w-5" />
)}
</Button>
</div>
<PasswordInput
id="password"
minLength={6}
maxLength={72}
className="bg-background mt-2"
autoComplete="current-password"
{...register('password')}
/>
<FormErrorMessage className="mt-1.5" error={errors.password} />
</div>
@@ -173,6 +214,67 @@ export const SignInForm = ({ className }: SignInFormProps) => {
<FcGoogle className="mr-2 h-5 w-5" />
Google
</Button>
<Dialog
open={isTwoFactorAuthenticationDialogOpen}
onOpenChange={onCloseTwoFactorAuthenticationDialog}
>
<DialogContent>
<DialogHeader>
<DialogTitle>Two-Factor Authentication</DialogTitle>
</DialogHeader>
<form onSubmit={handleSubmit(onFormSubmit)}>
{twoFactorAuthenticationMethod === 'totp' && (
<div>
<Label htmlFor="totpCode" className="text-muted-forground">
Authentication Token
</Label>
<Input
id="totpCode"
type="text"
className="bg-background mt-2"
{...register('totpCode')}
/>
<FormErrorMessage className="mt-1.5" error={errors.totpCode} />
</div>
)}
{twoFactorAuthenticationMethod === 'backup' && (
<div>
<Label htmlFor="backupCode" className="text-muted-forground">
Backup Code
</Label>
<Input
id="backupCode"
type="text"
className="bg-background mt-2"
{...register('backupCode')}
/>
<FormErrorMessage className="mt-1.5" error={errors.backupCode} />
</div>
)}
<div className="mt-4 flex items-center justify-between">
<Button
type="button"
variant="ghost"
onClick={onToggleTwoFactorAuthenticationMethodClick}
>
{twoFactorAuthenticationMethod === 'totp' ? 'Use Backup Code' : 'Use Authenticator'}
</Button>
<Button type="submit" loading={isSubmitting}>
Sign In
</Button>
</div>
</form>
</DialogContent>
</Dialog>
</form>
);
};

View File

@@ -10,6 +10,7 @@ import { z } from 'zod';
import { TRPCClientError } from '@documenso/trpc/client';
import { trpc } from '@documenso/trpc/react';
import { ZPasswordSchema } from '@documenso/trpc/server/auth-router/schema';
import { cn } from '@documenso/ui/lib/utils';
import { Button } from '@documenso/ui/primitives/button';
import { FormErrorMessage } from '@documenso/ui/primitives/form/form-error-message';
@@ -18,12 +19,22 @@ import { Label } from '@documenso/ui/primitives/label';
import { SignaturePad } from '@documenso/ui/primitives/signature-pad';
import { useToast } from '@documenso/ui/primitives/use-toast';
export const ZSignUpFormSchema = z.object({
name: z.string().trim().min(1, { message: 'Please enter a valid name.' }),
email: z.string().email().min(1),
password: z.string().min(6).max(72),
signature: z.string().min(1, { message: 'We need your signature to sign documents' }),
});
export const ZSignUpFormSchema = z
.object({
name: z.string().trim().min(1, { message: 'Please enter a valid name.' }),
email: z.string().email().min(1),
password: ZPasswordSchema,
signature: z.string().min(1, { message: 'We need your signature to sign documents' }),
})
.refine(
(data) => {
const { name, email, password } = data;
return !password.includes(name) && !password.includes(email.split('@')[0]);
},
{
message: 'Password should not be common or based on personal information',
},
);
export type TSignUpFormSchema = z.infer<typeof ZSignUpFormSchema>;

View File

@@ -1,53 +1,86 @@
###########################
# BASE CONTAINER #
###########################
FROM node:18-alpine AS base
# Install dependencies only when needed
FROM base AS production_deps
WORKDIR /app
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
# Copy our current monorepo
COPY . .
RUN npm ci --production
# Install dependencies only when needed
###########################
# BUILDER CONTAINER #
###########################
FROM base AS builder
WORKDIR /app
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
RUN apk add --no-cache jq
WORKDIR /app
# Copy our current monorepo
COPY . .
RUN TURBO_VERSION="$(npm list --package-lock-only --json turbo | jq -r '.dependencies.turbo.version')"
RUN npm install -g "turbo@$TURBO_VERSION"
# Outputs to the /out folder
# source: https://turbo.build/repo/docs/reference/command-line-reference/prune#--docker
RUN turbo prune --scope=@documenso/web --docker
###########################
# INSTALLER CONTAINER #
###########################
FROM base AS installer
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
RUN apk add --no-cache jq
# Required for node_modules/aws-crt
RUN apk add --no-cache make cmake g++
WORKDIR /app
# Disable husky from installing hooks
ENV HUSKY 0
ENV DOCKER_OUTPUT 1
ENV NEXT_TELEMETRY_DISABLED 1
# Uncomment and use build args to enable remote caching
# ARG TURBO_TEAM
# ENV TURBO_TEAM=$TURBO_TEAM
# ARG TURBO_TOKEN
# ENV TURBO_TOKEN=$TURBO_TOKEN
# First install the dependencies (as they change less often)
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/package-lock.json ./package-lock.json
RUN npm ci
RUN npm run build --workspaces
# Then copy all the source code (as it changes more often)
COPY --from=builder /app/out/full/ .
# Finally copy the turbo.json file so that we can run turbo commands
COPY turbo.json turbo.json
# Production image, copy all the files and run next
RUN TURBO_VERSION="$(npm list --package-lock-only --json turbo | jq -r '.dependencies.turbo.version')"
RUN npm install -g "turbo@$TURBO_VERSION"
RUN turbo run build --filter=@documenso/web...
###########################
# RUNNER CONTAINER #
###########################
FROM base AS runner
WORKDIR /app
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs
COPY --from=production_deps --chown=nextjs:nodejs /app/node_modules ./node_modules
COPY --from=production_deps --chown=nextjs:nodejs /app/package-lock.json ./package-lock.json
COPY --from=installer /app/apps/web/next.config.js .
COPY --from=installer /app/apps/web/package.json .
COPY --from=builder --chown=nextjs:nodejs /app/apps/web/package.json ./package.json
COPY --from=builder --chown=nextjs:nodejs /app/apps/web/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next ./.next
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public
EXPOSE 3000
ENV PORT 3000
CMD ["npm", "run", "start"]
CMD node apps/web/server.js

View File

@@ -17,3 +17,20 @@ services:
- 9000:9000
- 2500:2500
- 1100:1100
minio:
image: minio/minio
container_name: minio
ports:
- 9002:9002
- 9001:9001
volumes:
- minio:/data
environment:
MINIO_ROOT_USER: documenso
MINIO_ROOT_PASSWORD: password
entrypoint: sh
command: -c 'mkdir -p /data/documenso && minio server /data --console-address ":9001" --address ":9002"'
volumes:
minio:

32
docker/compose-test.yml Normal file
View File

@@ -0,0 +1,32 @@
name: documenso_test
services:
database:
image: postgres:15
environment:
- POSTGRES_USER=documenso
- POSTGRES_PASSWORD=password
- POSTGRES_DB=documenso
ports:
- 54322:5432
inbucket:
image: inbucket/inbucket
# ports:
# - 9000:9000
# - 2500:2500
# - 1100:1100
documenso:
build:
context: ../
dockerfile: docker/Dockerfile
depends_on:
- database
- inbucket
env_file:
- ../.env.example
environment:
- NEXT_PRIVATE_DATABASE_URL=postgres://documenso:password@database:5432/documenso
- NEXT_PRIVATE_DIRECT_DATABASE_URL=postgres://documenso:password@database:5432/documenso
ports:
- 3000:3000

View File

@@ -1,3 +1,4 @@
module.exports = {
'**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts,mdx}': ['prettier --write'],
'**/*/package.json': ['npm run precommit'],
};

1755
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,6 +6,7 @@
"dev": "turbo run dev --filter=@documenso/web --filter=@documenso/marketing",
"start": "cd apps && cd web && next start",
"lint": "turbo run lint",
"lint:fix": "turbo run lint:fix",
"format": "prettier --write \"**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts,mdx}\"",
"prepare": "husky install",
"commitlint": "commitlint --edit",
@@ -20,7 +21,8 @@
"prisma:migrate-deploy": "npm run with:env -- npm run prisma:migrate-deploy -w @documenso/prisma",
"prisma:studio": "npm run with:env -- npx prisma studio --schema packages/prisma/schema.prisma",
"with:env": "dotenv -e .env -e .env.local --",
"reset:hard": "npm run clean && npm i && npm run prisma:generate"
"reset:hard": "npm run clean && npm i && npm run prisma:generate",
"precommit": "npm install && git add package.json package-lock.json"
},
"engines": {
"npm": ">=8.6.0",
@@ -46,7 +48,7 @@
"packages/*"
],
"dependencies": {
"react-hotkeys-hook": "^4.4.1",
"recharts": "^2.7.2"
"recharts": "^2.7.2",
"react-hotkeys-hook": "^4.4.1"
}
}

View File

@@ -17,11 +17,11 @@
"worker:test": "tsup worker/index.ts --format esm"
},
"dependencies": {
"@documenso/nodemailer-resend": "1.0.0",
"@react-email/components": "^0.0.7",
"@documenso/nodemailer-resend": "2.0.0",
"@react-email/components": "^0.0.11",
"nodemailer": "^6.9.3",
"react-email": "^1.9.4",
"resend": "^1.1.0"
"react-email": "^1.9.5",
"resend": "^2.0.0"
},
"devDependencies": {
"@documenso/tailwind-config": "*",

View File

@@ -0,0 +1,52 @@
import { Button, Section, Tailwind, Text } from '@react-email/components';
import * as config from '@documenso/tailwind-config';
import { TemplateDocumentImage } from './template-document-image';
export type TemplateConfirmationEmailProps = {
confirmationLink: string;
assetBaseUrl: string;
};
export const TemplateConfirmationEmail = ({
confirmationLink,
assetBaseUrl,
}: TemplateConfirmationEmailProps) => {
return (
<Tailwind
config={{
theme: {
extend: {
colors: config.theme.extend.colors,
},
},
}}
>
<TemplateDocumentImage className="mt-6" assetBaseUrl={assetBaseUrl} />
<Section className="flex-row items-center justify-center">
<Text className="text-primary mx-auto mb-0 max-w-[80%] text-center text-lg font-semibold">
Welcome to Documenso!
</Text>
<Text className="my-1 text-center text-base text-slate-400">
Before you get started, please confirm your email address by clicking the button below:
</Text>
<Section className="mb-6 mt-8 text-center">
<Button
className="bg-documenso-500 inline-flex items-center justify-center rounded-lg px-6 py-3 text-center text-sm font-medium text-black no-underline"
href={confirmationLink}
>
Confirm email
</Button>
<Text className="mt-8 text-center text-sm italic text-slate-400">
You can also copy and paste this link into your browser: {confirmationLink} (link
expires in 1 hour)
</Text>
</Section>
</Section>
</Tailwind>
);
};

View File

@@ -0,0 +1,69 @@
import {
Body,
Container,
Head,
Html,
Img,
Preview,
Section,
Tailwind,
} from '@react-email/components';
import config from '@documenso/tailwind-config';
import {
TemplateConfirmationEmail,
TemplateConfirmationEmailProps,
} from '../template-components/template-confirmation-email';
import { TemplateFooter } from '../template-components/template-footer';
export const ConfirmEmailTemplate = ({
confirmationLink,
assetBaseUrl,
}: TemplateConfirmationEmailProps) => {
const previewText = `Please confirm your email address`;
const getAssetUrl = (path: string) => {
return new URL(path, assetBaseUrl).toString();
};
return (
<Html>
<Head />
<Preview>{previewText}</Preview>
<Tailwind
config={{
theme: {
extend: {
colors: config.theme.extend.colors,
},
},
}}
>
<Body className="mx-auto my-auto bg-white font-sans">
<Section>
<Container className="mx-auto mb-2 mt-8 max-w-xl rounded-lg border border-solid border-slate-200 p-4 backdrop-blur-sm">
<Section>
<Img
src={getAssetUrl('/static/logo.png')}
alt="Documenso Logo"
className="mb-4 h-6"
/>
<TemplateConfirmationEmail
confirmationLink={confirmationLink}
assetBaseUrl={assetBaseUrl}
/>
</Section>
</Container>
<div className="mx-auto mt-12 max-w-xl" />
<Container className="mx-auto max-w-xl">
<TemplateFooter isDocument={false} />
</Container>
</Section>
</Body>
</Tailwind>
</Html>
);
};

View File

@@ -14,10 +14,8 @@ import {
import config from '@documenso/tailwind-config';
import {
TemplateDocumentInvite,
TemplateDocumentInviteProps,
} from '../template-components/template-document-invite';
import type { TemplateDocumentInviteProps } from '../template-components/template-document-invite';
import { TemplateDocumentInvite } from '../template-components/template-document-invite';
import { TemplateFooter } from '../template-components/template-footer';
export type DocumentInviteEmailTemplateProps = Partial<TemplateDocumentInviteProps> & {

View File

@@ -2,14 +2,13 @@ module.exports = {
extends: [
'next',
'turbo',
'prettier',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:package-json/recommended',
],
plugins: ['prettier', 'package-json'],
plugins: ['prettier', 'package-json', 'unused-imports'],
env: {
node: true,
@@ -30,12 +29,22 @@ module.exports = {
},
rules: {
'@next/next/no-html-link-for-pages': 'off',
'react/no-unescaped-entities': 'off',
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'warn',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
},
],
'no-duplicate-imports': 'error',
'no-multi-spaces': [
'error',
{
@@ -67,5 +76,14 @@ module.exports = {
// To handle this we want this rule to catch usages and highlight them as
// warnings so we can write appropriate interfaces and guards later.
'@typescript-eslint/consistent-type-assertions': ['warn', { assertionStyle: 'never' }],
'@typescript-eslint/consistent-type-imports': [
'warn',
{
prefer: 'type-imports',
fixStyle: 'separate-type-imports',
disallowTypeAnnotations: false,
},
],
},
};

View File

@@ -16,6 +16,7 @@
"eslint-plugin-package-json": "^0.1.4",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-unused-imports": "^3.0.0",
"typescript": "5.2.2"
}
}

View File

@@ -1,4 +1,5 @@
import { ReadStatus, Recipient, SendStatus, SigningStatus } from '@documenso/prisma/client';
import type { Recipient } from '@documenso/prisma/client';
import { ReadStatus, SendStatus, SigningStatus } from '@documenso/prisma/client';
export const getRecipientType = (recipient: Recipient) => {
if (

View File

@@ -0,0 +1 @@
export const DOCUMENSO_ENCRYPTION_KEY = process.env.NEXT_PRIVATE_ENCRYPTION_KEY;

View File

@@ -0,0 +1,71 @@
import { DateTime } from 'luxon';
import { DEFAULT_DOCUMENT_TIME_ZONE } from './time-zones';
export const DEFAULT_DOCUMENT_DATE_FORMAT = 'yyyy-MM-dd hh:mm a';
export const DATE_FORMATS = [
{
key: 'YYYYMMDD',
label: 'YYYY-MM-DD',
value: DEFAULT_DOCUMENT_DATE_FORMAT,
},
{
key: 'DDMMYYYY',
label: 'DD/MM/YYYY',
value: 'dd/MM/yyyy hh:mm a',
},
{
key: 'MMDDYYYY',
label: 'MM/DD/YYYY',
value: 'MM/dd/yyyy hh:mm a',
},
{
key: 'YYYYMMDDHHmm',
label: 'YYYY-MM-DD HH:mm',
value: 'yyyy-MM-dd HH:mm',
},
{
key: 'YYMMDD',
label: 'YY-MM-DD',
value: 'yy-MM-dd hh:mm a',
},
{
key: 'YYYYMMDDhhmmss',
label: 'YYYY-MM-DD HH:mm:ss',
value: 'yyyy-MM-dd HH:mm:ss',
},
{
key: 'MonthDateYear',
label: 'Month Date, Year',
value: 'MMMM dd, yyyy hh:mm a',
},
{
key: 'DayMonthYear',
label: 'Day, Month Year',
value: 'EEEE, MMMM dd, yyyy hh:mm a',
},
{
key: 'ISO8601',
label: 'ISO 8601',
value: "yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
},
];
export const convertToLocalSystemFormat = (
customText: string,
dateFormat: string | null = DEFAULT_DOCUMENT_DATE_FORMAT,
timeZone: string | null = DEFAULT_DOCUMENT_TIME_ZONE,
): string => {
const parsedDate = DateTime.fromFormat(customText, dateFormat ?? DEFAULT_DOCUMENT_DATE_FORMAT, {
zone: timeZone ?? DEFAULT_DOCUMENT_TIME_ZONE,
});
if (!parsedDate.isValid) {
return 'Invalid date';
}
const formattedDate = parsedDate.toLocal().toFormat(dateFormat ?? DEFAULT_DOCUMENT_DATE_FORMAT);
return formattedDate;
};

View File

@@ -0,0 +1,44 @@
import { rawTimeZones, timeZonesNames } from '@vvo/tzdb';
export const TIME_ZONE_DATA = rawTimeZones;
export const DEFAULT_DOCUMENT_TIME_ZONE = 'Etc/UTC';
export type TimeZone = {
name: string;
rawOffsetInMinutes: number;
};
export const minutesToHours = (minutes: number): string => {
const hours = Math.abs(Math.floor(minutes / 60));
const min = Math.abs(minutes % 60);
const sign = minutes >= 0 ? '+' : '-';
return `${sign}${String(hours).padStart(2, '0')}:${String(min).padStart(2, '0')}`;
};
const getGMTOffsets = (timezones: TimeZone[]): string[] => {
const gmtOffsets: string[] = [];
for (const timezone of timezones) {
const offsetValue = minutesToHours(timezone.rawOffsetInMinutes);
const gmtText = `(${offsetValue})`;
gmtOffsets.push(`${timezone.name} ${gmtText}`);
}
return gmtOffsets;
};
export const splitTimeZone = (input: string | null): string => {
if (input === null) {
return '';
}
const [timeZone] = input.split('(');
return timeZone.trim();
};
export const TIME_ZONES_FULL = getGMTOffsets(TIME_ZONE_DATA);
export const TIME_ZONES = ['Etc/UTC', ...timeZonesNames];

View File

@@ -1,12 +1,15 @@
import { PrismaAdapter } from '@next-auth/prisma-adapter';
import { compare } from 'bcrypt';
import { DateTime } from 'luxon';
import { AuthOptions, Session, User } from 'next-auth';
import type { AuthOptions, Session, User } from 'next-auth';
import CredentialsProvider from 'next-auth/providers/credentials';
import GoogleProvider, { GoogleProfile } from 'next-auth/providers/google';
import type { GoogleProfile } from 'next-auth/providers/google';
import GoogleProvider from 'next-auth/providers/google';
import { prisma } from '@documenso/prisma';
import { isTwoFactorAuthenticationEnabled } from '../server-only/2fa/is-2fa-availble';
import { validateTwoFactorAuthentication } from '../server-only/2fa/validate-2fa';
import { getUserByEmail } from '../server-only/user/get-user-by-email';
import { ErrorCode } from './error-codes';
@@ -22,13 +25,19 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
credentials: {
email: { label: 'Email', type: 'email' },
password: { label: 'Password', type: 'password' },
totpCode: {
label: 'Two-factor Code',
type: 'input',
placeholder: 'Code from authenticator app',
},
backupCode: { label: 'Backup Code', type: 'input', placeholder: 'Two-factor backup code' },
},
authorize: async (credentials, _req) => {
if (!credentials) {
throw new Error(ErrorCode.CREDENTIALS_NOT_FOUND);
}
const { email, password } = credentials;
const { email, password, backupCode, totpCode } = credentials;
const user = await getUserByEmail({ email }).catch(() => {
throw new Error(ErrorCode.INCORRECT_EMAIL_PASSWORD);
@@ -44,6 +53,20 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
throw new Error(ErrorCode.INCORRECT_EMAIL_PASSWORD);
}
const is2faEnabled = isTwoFactorAuthenticationEnabled({ user });
if (is2faEnabled) {
const isValid = await validateTwoFactorAuthentication({ backupCode, totpCode, user });
if (!isValid) {
throw new Error(
totpCode
? ErrorCode.INCORRECT_TWO_FACTOR_CODE
: ErrorCode.INCORRECT_TWO_FACTOR_BACKUP_CODE,
);
}
}
return {
id: Number(user.id),
email: user.email,
@@ -88,6 +111,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
merged.id = retrieved.id;
merged.name = retrieved.name;
merged.email = retrieved.email;
merged.emailVerified = retrieved.emailVerified;
}
if (
@@ -112,6 +136,7 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
name: merged.name,
email: merged.email,
lastSignedIn: merged.lastSignedIn,
emailVerified: merged.emailVerified,
};
},
@@ -123,6 +148,8 @@ export const NEXT_AUTH_OPTIONS: AuthOptions = {
id: Number(token.id),
name: token.name,
email: token.email,
emailVerified:
typeof token.emailVerified === 'string' ? new Date(token.emailVerified) : null,
},
} satisfies Session;
}

View File

@@ -8,4 +8,15 @@ export const ErrorCode = {
INCORRECT_EMAIL_PASSWORD: 'INCORRECT_EMAIL_PASSWORD',
USER_MISSING_PASSWORD: 'USER_MISSING_PASSWORD',
CREDENTIALS_NOT_FOUND: 'CREDENTIALS_NOT_FOUND',
INTERNAL_SEVER_ERROR: 'INTERNAL_SEVER_ERROR',
TWO_FACTOR_ALREADY_ENABLED: 'TWO_FACTOR_ALREADY_ENABLED',
TWO_FACTOR_SETUP_REQUIRED: 'TWO_FACTOR_SETUP_REQUIRED',
TWO_FACTOR_MISSING_SECRET: 'TWO_FACTOR_MISSING_SECRET',
TWO_FACTOR_MISSING_CREDENTIALS: 'TWO_FACTOR_MISSING_CREDENTIALS',
INCORRECT_TWO_FACTOR_CODE: 'INCORRECT_TWO_FACTOR_CODE',
INCORRECT_TWO_FACTOR_BACKUP_CODE: 'INCORRECT_TWO_FACTOR_BACKUP_CODE',
INCORRECT_IDENTITY_PROVIDER: 'INCORRECT_IDENTITY_PROVIDER',
INCORRECT_PASSWORD: 'INCORRECT_PASSWORD',
MISSING_ENCRYPTION_KEY: 'MISSING_ENCRYPTION_KEY',
MISSING_BACKUP_CODE: 'MISSING_BACKUP_CODE',
} as const;

View File

@@ -0,0 +1,35 @@
'use server';
import { cache } from 'react';
import { getServerSession as getNextAuthServerSession } from 'next-auth';
import { prisma } from '@documenso/prisma';
import { NEXT_AUTH_OPTIONS } from './auth-options';
export const getServerComponentSession = cache(async () => {
const session = await getNextAuthServerSession(NEXT_AUTH_OPTIONS);
if (!session || !session.user?.email) {
return { user: null, session: null };
}
const user = await prisma.user.findFirstOrThrow({
where: {
email: session.user.email,
},
});
return { user, session };
});
export const getRequiredServerComponentSession = cache(async () => {
const { user, session } = await getServerComponentSession();
if (!user || !session) {
throw new Error('No session found');
}
return { user, session };
});

View File

@@ -1,4 +1,6 @@
import { GetServerSidePropsContext, NextApiRequest, NextApiResponse } from 'next';
'use server';
import type { GetServerSidePropsContext, NextApiRequest, NextApiResponse } from 'next';
import { getServerSession as getNextAuthServerSession } from 'next-auth';
@@ -26,29 +28,3 @@ export const getServerSession = async ({ req, res }: GetServerSessionOptions) =>
return { user, session };
};
export const getServerComponentSession = async () => {
const session = await getNextAuthServerSession(NEXT_AUTH_OPTIONS);
if (!session || !session.user?.email) {
return { user: null, session: null };
}
const user = await prisma.user.findFirstOrThrow({
where: {
email: session.user.email,
},
});
return { user, session };
};
export const getRequiredServerComponentSession = async () => {
const { user, session } = await getServerComponentSession();
if (!user || !session) {
throw new Error('No session found');
}
return { user, session };
};

View File

@@ -11,6 +11,8 @@
"next-auth/"
],
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"clean": "rimraf node_modules"
},
"dependencies": {
@@ -22,15 +24,19 @@
"@documenso/prisma": "*",
"@documenso/signing": "*",
"@next-auth/prisma-adapter": "1.0.7",
"@noble/ciphers": "0.4.0",
"@noble/hashes": "1.3.2",
"@pdf-lib/fontkit": "^1.1.1",
"@scure/base": "^1.1.3",
"@sindresorhus/slugify": "^2.2.1",
"@upstash/redis": "^1.20.6",
"@vvo/tzdb": "^6.117.0",
"bcrypt": "^5.1.0",
"luxon": "^3.4.0",
"nanoid": "^4.0.2",
"next": "14.0.0",
"next-auth": "4.24.3",
"oslo": "^0.17.0",
"pdf-lib": "^1.17.1",
"react": "18.2.0",
"remeda": "^1.27.1",

View File

@@ -0,0 +1,48 @@
import { compare } from 'bcrypt';
import { prisma } from '@documenso/prisma';
import { User } from '@documenso/prisma/client';
import { ErrorCode } from '../../next-auth/error-codes';
import { validateTwoFactorAuthentication } from './validate-2fa';
type DisableTwoFactorAuthenticationOptions = {
user: User;
backupCode: string;
password: string;
};
export const disableTwoFactorAuthentication = async ({
backupCode,
user,
password,
}: DisableTwoFactorAuthenticationOptions) => {
if (!user.password) {
throw new Error(ErrorCode.USER_MISSING_PASSWORD);
}
const isCorrectPassword = await compare(password, user.password);
if (!isCorrectPassword) {
throw new Error(ErrorCode.INCORRECT_PASSWORD);
}
const isValid = await validateTwoFactorAuthentication({ backupCode, user });
if (!isValid) {
throw new Error(ErrorCode.INCORRECT_TWO_FACTOR_BACKUP_CODE);
}
await prisma.user.update({
where: {
id: user.id,
},
data: {
twoFactorEnabled: false,
twoFactorBackupCodes: null,
twoFactorSecret: null,
},
});
return true;
};

View File

@@ -0,0 +1,47 @@
import { ErrorCode } from '@documenso/lib/next-auth/error-codes';
import { prisma } from '@documenso/prisma';
import { User } from '@documenso/prisma/client';
import { getBackupCodes } from './get-backup-code';
import { verifyTwoFactorAuthenticationToken } from './verify-2fa-token';
type EnableTwoFactorAuthenticationOptions = {
user: User;
code: string;
};
export const enableTwoFactorAuthentication = async ({
user,
code,
}: EnableTwoFactorAuthenticationOptions) => {
if (user.identityProvider !== 'DOCUMENSO') {
throw new Error(ErrorCode.INCORRECT_IDENTITY_PROVIDER);
}
if (user.twoFactorEnabled) {
throw new Error(ErrorCode.TWO_FACTOR_ALREADY_ENABLED);
}
if (!user.twoFactorSecret) {
throw new Error(ErrorCode.TWO_FACTOR_SETUP_REQUIRED);
}
const isValidToken = await verifyTwoFactorAuthenticationToken({ user, totpCode: code });
if (!isValidToken) {
throw new Error(ErrorCode.INCORRECT_TWO_FACTOR_CODE);
}
const updatedUser = await prisma.user.update({
where: {
id: user.id,
},
data: {
twoFactorEnabled: true,
},
});
const recoveryCodes = getBackupCodes({ user: updatedUser });
return { recoveryCodes };
};

View File

@@ -0,0 +1,38 @@
import { z } from 'zod';
import { User } from '@documenso/prisma/client';
import { DOCUMENSO_ENCRYPTION_KEY } from '../../constants/crypto';
import { symmetricDecrypt } from '../../universal/crypto';
interface GetBackupCodesOptions {
user: User;
}
const ZBackupCodeSchema = z.array(z.string());
export const getBackupCodes = ({ user }: GetBackupCodesOptions) => {
const key = DOCUMENSO_ENCRYPTION_KEY;
if (!user.twoFactorEnabled) {
throw new Error('User has not enabled 2FA');
}
if (!user.twoFactorBackupCodes) {
throw new Error('User has no backup codes');
}
const secret = Buffer.from(symmetricDecrypt({ key, data: user.twoFactorBackupCodes })).toString(
'utf-8',
);
const data = JSON.parse(secret);
const result = ZBackupCodeSchema.safeParse(data);
if (result.success) {
return result.data;
}
return null;
};

View File

@@ -0,0 +1,17 @@
import { User } from '@documenso/prisma/client';
import { DOCUMENSO_ENCRYPTION_KEY } from '../../constants/crypto';
type IsTwoFactorAuthenticationEnabledOptions = {
user: User;
};
export const isTwoFactorAuthenticationEnabled = ({
user,
}: IsTwoFactorAuthenticationEnabledOptions) => {
return (
user.twoFactorEnabled &&
user.identityProvider === 'DOCUMENSO' &&
typeof DOCUMENSO_ENCRYPTION_KEY === 'string'
);
};

View File

@@ -0,0 +1,76 @@
import { base32 } from '@scure/base';
import { compare } from 'bcrypt';
import crypto from 'crypto';
import { createTOTPKeyURI } from 'oslo/otp';
import { ErrorCode } from '@documenso/lib/next-auth/error-codes';
import { prisma } from '@documenso/prisma';
import { User } from '@documenso/prisma/client';
import { DOCUMENSO_ENCRYPTION_KEY } from '../../constants/crypto';
import { symmetricEncrypt } from '../../universal/crypto';
type SetupTwoFactorAuthenticationOptions = {
user: User;
password: string;
};
const ISSUER = 'Documenso';
export const setupTwoFactorAuthentication = async ({
user,
password,
}: SetupTwoFactorAuthenticationOptions) => {
const key = DOCUMENSO_ENCRYPTION_KEY;
if (!key) {
throw new Error(ErrorCode.MISSING_ENCRYPTION_KEY);
}
if (user.identityProvider !== 'DOCUMENSO') {
throw new Error(ErrorCode.INCORRECT_IDENTITY_PROVIDER);
}
if (!user.password) {
throw new Error(ErrorCode.USER_MISSING_PASSWORD);
}
const isCorrectPassword = await compare(password, user.password);
if (!isCorrectPassword) {
throw new Error(ErrorCode.INCORRECT_PASSWORD);
}
const secret = crypto.randomBytes(10);
const backupCodes = new Array(10)
.fill(null)
.map(() => crypto.randomBytes(5).toString('hex'))
.map((code) => `${code.slice(0, 5)}-${code.slice(5)}`.toUpperCase());
const accountName = user.email;
const uri = createTOTPKeyURI(ISSUER, accountName, secret);
const encodedSecret = base32.encode(secret);
await prisma.user.update({
where: {
id: user.id,
},
data: {
twoFactorEnabled: false,
twoFactorBackupCodes: symmetricEncrypt({
data: JSON.stringify(backupCodes),
key: key,
}),
twoFactorSecret: symmetricEncrypt({
data: encodedSecret,
key: key,
}),
},
});
return {
secret: encodedSecret,
uri,
};
};

View File

@@ -0,0 +1,35 @@
import { User } from '@documenso/prisma/client';
import { ErrorCode } from '../../next-auth/error-codes';
import { verifyTwoFactorAuthenticationToken } from './verify-2fa-token';
import { verifyBackupCode } from './verify-backup-code';
type ValidateTwoFactorAuthenticationOptions = {
totpCode?: string;
backupCode?: string;
user: User;
};
export const validateTwoFactorAuthentication = async ({
backupCode,
totpCode,
user,
}: ValidateTwoFactorAuthenticationOptions) => {
if (!user.twoFactorEnabled) {
throw new Error(ErrorCode.TWO_FACTOR_SETUP_REQUIRED);
}
if (!user.twoFactorSecret) {
throw new Error(ErrorCode.TWO_FACTOR_MISSING_SECRET);
}
if (totpCode) {
return await verifyTwoFactorAuthenticationToken({ user, totpCode });
}
if (backupCode) {
return await verifyBackupCode({ user, backupCode });
}
throw new Error(ErrorCode.TWO_FACTOR_MISSING_CREDENTIALS);
};

View File

@@ -0,0 +1,33 @@
import { base32 } from '@scure/base';
import { TOTPController } from 'oslo/otp';
import { User } from '@documenso/prisma/client';
import { DOCUMENSO_ENCRYPTION_KEY } from '../../constants/crypto';
import { symmetricDecrypt } from '../../universal/crypto';
const totp = new TOTPController();
type VerifyTwoFactorAuthenticationTokenOptions = {
user: User;
totpCode: string;
};
export const verifyTwoFactorAuthenticationToken = async ({
user,
totpCode,
}: VerifyTwoFactorAuthenticationTokenOptions) => {
const key = DOCUMENSO_ENCRYPTION_KEY;
if (!user.twoFactorSecret) {
throw new Error('user missing 2fa secret');
}
const secret = Buffer.from(symmetricDecrypt({ key, data: user.twoFactorSecret })).toString(
'utf-8',
);
const isValidToken = await totp.verify(totpCode, base32.decode(secret));
return isValidToken;
};

View File

@@ -0,0 +1,18 @@
import { User } from '@documenso/prisma/client';
import { getBackupCodes } from './get-backup-code';
type VerifyBackupCodeParams = {
user: User;
backupCode: string;
};
export const verifyBackupCode = async ({ user, backupCode }: VerifyBackupCodeParams) => {
const userBackupCodes = await getBackupCodes({ user });
if (!userBackupCodes) {
throw new Error('User has no backup codes');
}
return userBackupCodes.includes(backupCode);
};

View File

@@ -1,4 +1,4 @@
import { hashSync as bcryptHashSync } from 'bcrypt';
import { compareSync as bcryptCompareSync, hashSync as bcryptHashSync } from 'bcrypt';
import { SALT_ROUNDS } from '../../constants/auth';
@@ -8,3 +8,7 @@ import { SALT_ROUNDS } from '../../constants/auth';
export const hashSync = (password: string) => {
return bcryptHashSync(password, SALT_ROUNDS);
};
export const compareSync = (password: string, hash: string) => {
return bcryptCompareSync(password, hash);
};

View File

@@ -0,0 +1,56 @@
import { createElement } from 'react';
import { mailer } from '@documenso/email/mailer';
import { render } from '@documenso/email/render';
import { ConfirmEmailTemplate } from '@documenso/email/templates/confirm-email';
import { prisma } from '@documenso/prisma';
export interface SendConfirmationEmailProps {
userId: number;
}
export const sendConfirmationEmail = async ({ userId }: SendConfirmationEmailProps) => {
const user = await prisma.user.findFirstOrThrow({
where: {
id: userId,
},
include: {
VerificationToken: {
orderBy: {
createdAt: 'desc',
},
take: 1,
},
},
});
const [verificationToken] = user.VerificationToken;
if (!verificationToken?.token) {
throw new Error('Verification token not found for the user');
}
const assetBaseUrl = process.env.NEXT_PUBLIC_WEBAPP_URL || 'http://localhost:3000';
const confirmationLink = `${assetBaseUrl}/verify-email/${verificationToken.token}`;
const senderName = process.env.NEXT_PRIVATE_SMTP_FROM_NAME || 'Documenso';
const senderAdress = process.env.NEXT_PRIVATE_SMTP_FROM_ADDRESS || 'noreply@documenso.com';
const confirmationTemplate = createElement(ConfirmEmailTemplate, {
assetBaseUrl,
confirmationLink,
});
return mailer.sendMail({
to: {
address: user.email,
name: user.name || '',
},
from: {
name: senderName,
address: senderAdress,
},
subject: 'Please confirm your email',
html: render(confirmationTemplate),
text: render(confirmationTemplate, { plainText: true }),
});
};

View File

@@ -6,11 +6,15 @@ export type CreateDocumentMetaOptions = {
documentId: number;
subject: string;
message: string;
timezone: string;
dateFormat: string;
};
export const upsertDocumentMeta = async ({
subject,
message,
timezone,
dateFormat,
documentId,
}: CreateDocumentMetaOptions) => {
return await prisma.documentMeta.upsert({
@@ -20,11 +24,15 @@ export const upsertDocumentMeta = async ({
create: {
subject,
message,
dateFormat,
timezone,
documentId,
},
update: {
subject,
message,
dateFormat,
timezone,
},
});
};

View File

@@ -25,6 +25,8 @@ export const duplicateDocumentById = async ({ id, userId }: DuplicateDocumentByI
select: {
message: true,
subject: true,
dateFormat: true,
timezone: true,
},
},
},

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