Commit Graph

231 Commits

Author SHA1 Message Date
Tom Moor
e1b29bd854 chore: Store refresh tokens for Linear integration (#10047)
* wip

* Store expiry

* refreshTokenIfNeeded

* toDate

* self review

* refactor
2025-09-13 22:55:38 -04:00
Tom Moor
1da18c3101 chore: Refactor useActionContext to use React context (#10140)
* chore: Refactor useActionContext to use React context

* Self review

* PR feedback
2025-09-09 23:22:46 +00:00
Tom Moor
5d5bed8270 chore: Refactor auth/CSRF middleware (#10113)
* chore: Refactor auth/CSRF middleware

* sp
2025-09-07 08:36:46 -04:00
Tom Moor
9b17f91c9a fix: CSRF missing during email callback (#10107)
* fix: CSRF missing during email callback

* refactor
2025-09-06 11:26:03 -04:00
Tom Moor
a73a8626c5 fix: Allow access to private IP address for OIDC (#10059) 2025-08-31 12:44:37 -04:00
Hemachandar
0de2a3dc98 Skip Notion linked database views (#10018) 2025-08-26 16:14:44 -04:00
Tom Moor
dd061790a8 fix: Frontend requests do not send Content-Type header in request (#9956)
* Revert "Revert "fix: Frontend requests do not send Content-Type in request (#…"

This reverts commit 7fddd99c28.

* Update authentication.ts
2025-08-17 21:47:06 +00:00
Tom Moor
7fddd99c28 Revert "fix: Frontend requests do not send Content-Type in request (#9954)" (#9955)
This reverts commit 7ab7e6efb7.
2025-08-17 21:42:28 +00:00
Tom Moor
7ab7e6efb7 fix: Frontend requests do not send Content-Type in request (#9954) 2025-08-17 16:02:56 -04:00
Tom Moor
c83a6b4f41 fix: Usage of ctx.attachment overrides explicit Content-Type (#9949) 2025-08-16 11:29:00 -04:00
Tom Moor
dcd7a050bd chore: Formatting (#9939) 2025-08-14 22:49:07 -04:00
Tom Moor
e8046f0d2f fix: Tighten rate limits on email.callback endpoint from defaults (#9917) 2025-08-13 22:45:03 -04:00
codegen-sh[bot]
4fc6ac1f15 Add in-app reaction notifications (#9893)
* Add ReactionsCreate notification event type

- Add ReactionsCreate to NotificationEventType enum and defaults
- Add notification settings UI with SmileyIcon and proper labels
- Create ReactionsCreateNotificationsTask to handle comment reactions
- Update NotificationsProcessor to handle comments.add_reaction events
- Add eventText and path handling in client Notification model
- Notifications are enabled by default but never send emails

* Applied automatic fixes

* Show the actual emoji in the notification

* Cleanup notifications if reaction is removed

* PR feedback

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-08-11 18:54:43 -04:00
Hemachandar
04c3d81b1f chore: Setup missing oxlint configs (#9862)
* shared

* server

* app

* remove vestigial eslintrc files

* update comment directives
2025-08-06 19:54:22 -04:00
Hemachandar
b4757dfc6c Allow disconnecting analytics integrations (#9823)
* Allow disconnecting analytic integrations

* review
2025-08-05 07:36:48 -04:00
codegen-sh[bot]
6c2313919b Improve webhook disabling heuristic with time-based analysis (#9800)
* Improve webhook disabling heuristic with time-based analysis

- Add WEBHOOK_FAILURE_TIME_WINDOW environment variable (default: 24 hours)
- Add WEBHOOK_FAILURE_RATE_THRESHOLD environment variable (default: 80%)
- Replace simple count-based logic with time-window failure rate analysis
- Require minimum 5 deliveries in time window before disabling
- Add comprehensive logging for webhook failure analysis
- Update email template to reflect new time-based approach

Addresses GitHub issue #9788 by making webhook disabling smarter and
considering time factors instead of just consecutive failure counts.

* Fix Logger.warn type error

Remove extra 'task' parameter from Logger.warn call to match the correct
signature: Logger.warn(message: string, extra?: Extra)

* Update WEBHOOK_FAILURE_TIME_WINDOW to use seconds instead of hours

- Change default value from 24 (hours) to 86400 (seconds)
- Update time conversion logic from hours*60*60*1000 to seconds*1000
- Rename timeWindowHours variable to timeWindowSeconds for clarity
- Update documentation comments to reflect seconds-based configuration

This provides more granular control while maintaining the same default
behavior (24 hours = 86400 seconds).

* Improve webhook failure logging and analysis threshold

- Only log webhook failure analysis when failedDeliveries.length > 0
- Extract hardcoded minimum deliveries threshold to constant
- Update minimum deliveries threshold from 5 to 10 for more reliable analysis

This reduces log noise when there are no failures and requires more data
points before considering webhook disabling.

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
2025-08-03 15:39:04 -04:00
Hemachandar
d3eb3db7ba feat: Public sharing of collections (#9529)
* shares.info, collections.info, documents.info

* shares.list, shares.create, shares.update

* shares.sitemap

* parity with existing document shared screen

* collection share popover

* parent share and table

* collection scene

* collection link in sidebar

* sidebar and breadcrumb collection link click

* collection link click in editor

* meta

* more meta + 404 page

* map internal link, remove showLastUpdated option

* fix shares.list pagination

* show last updated

* shareLoader tests

* lint

* sidebar context for collection link

* badge in shares table

* fix existing tests

* tsc

* update failing test snapshot

* env

* signed url for collection attachments

* include collection content in SSR for screen readers

* search

* drafts can be shared

* review

* tsc, remove old shared-doc scene

* tweaks

* DRY

* refactor loader

* Remove share/collection urls

* fix: Collection overview should not be editable when viewing shared link and logged in

* Tweak public breadcrumb

* fix: Deleted documents should never be exposed through share

* empty sharedTree array where includeChildDocuments is false

* revert includeChildDocs guard for logical correctness + SSR bug fix

* fix: check document is part of share

---------

Co-authored-by: Tom Moor <tom@getoutline.com>
2025-08-03 13:07:39 -04:00
Tom Moor
cc591ebc66 Conversion of User to event system (#9741)
* Conversion of User to event system

* fix

* warning

* fixes

* Skip lastActiveAt in changeset

* fix: Skip count in view changeset

* refactor: Remove userDestroyer

* refactor: Remove userSuspender

* refactor: Remove userUnsuspender

* tests
2025-07-27 13:15:21 -04:00
Neha Prasad
27d0fe86d1 fix: extract domain from user email in Slack authentication (#9742)
* fix: extract domain from user email in Slack authentication

Fixes #9641 - Slack auth fails when OIDC is enabled

* Added tests for domain extraction functionality
Added parseEmail import

* Fix Slack OIDC authentication to retain original subdomain logic (profile.team.domain) while adding domain extraction from user email

* Update slack.ts

---------

Co-authored-by: Tom Moor <tom@getoutline.com>
2025-07-27 12:24:33 -04:00
Tom Moor
4f3e8ef4af fix: Add improved logs for incorrect userinfo endpoint OIDC (#9707) 2025-07-22 02:10:02 +00:00
Hemachandar
58d3fad84f Stricter guards for text nodes in Notion import (#9675) 2025-07-18 07:46:34 -04:00
Hemachandar
7d315288dd Listen to GitHub webhooks to update issueSources cache (#9414)
* Listen to GitHub webhooks to update issue-sources cache

* Add `GitHubWebhookTask`

* review
2025-07-15 23:07:14 -04:00
Tom Moor
772eb2f1d4 fix: randomstring dep does not work in browser with rolldown-vite (#9624)
* fix: randomstring dep does not work in browser with rolldown-vite

* fix: Last usage of randomstring, docs

* feedback
2025-07-13 09:33:16 -04:00
Tom Moor
932f3333f1 fix: Refresh tokens do not work with OIDC discovery (#9618) 2025-07-12 06:44:23 -04:00
Tom Moor
928ec064ee fix: Viewers unable to connect personal Slack (#9614) 2025-07-11 17:41:59 -04:00
Hemachandar
d4cdf4202f InputSelectPermission component (#9585) 2025-07-10 08:46:19 -04:00
codegen-sh[bot]
97f8d0f265 Separate Prettier and ESLint according to best practices (#9565)
* Separate Prettier and ESLint according to best practices

- Create standalone .prettierrc configuration file
- Remove eslint-plugin-prettier integration from ESLint config
- Replace with eslint-config-prettier to disable conflicting rules
- Remove eslint-plugin-prettier dependency
- Add dedicated format and format:check scripts
- Update lint-staged to run Prettier and ESLint separately
- Format entire codebase with new Prettier configuration

This follows the recommended approach from Prettier documentation:
https://prettier.io/docs/integrating-with-linters#notes

* Remove test comment

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
2025-07-08 18:01:48 -04:00
Tom Moor
a6b0fcff48 feat: Add OTP sign-in for PWA (#9556)
* wip

* wip

* wip

* Only use code for desktop and PWA
2025-07-07 18:36:43 -04:00
Hemachandar
29c07d6dee Migrate remaining popovers to Radix (#9555)
* reaction picker

* api key expiry date picker

* find and replace popover

* slack list item
2025-07-06 08:53:47 -04:00
codegen-sh[bot]
3fd09ca0bf Fix OIDC well-known discovery for subdirectories (#9540)
* Fix OIDC well-known discovery for subdirectories

- Fix URL construction in fetchOIDCConfiguration to properly handle issuer URLs with subdirectories
- Replace incorrect use of new URL() constructor that was treating well-known path as absolute
- Add proper path concatenation that preserves subdirectories in issuer URLs
- Add comprehensive test cases for subdirectory scenarios
- Fixes issue where https://auth.example.com/application/o/outline/ would incorrectly resolve to https://auth.example.com/.well-known/openid-configuration instead of https://auth.example.com/application/o/outline/.well-known/openid-configuration

Fixes #9535

* Refactor to use wellKnownPath variable instead of hardcoded path

- Use wellKnownPath.substring(1) to remove leading slash when appending to pathname
- Eliminates duplication of the .well-known/openid-configuration path
- Improves maintainability by using the existing variable consistently

* Simplify logic by checking pathname does not end with slash

- If pathname doesn't end with slash, append full wellKnownPath (with leading slash)
- If pathname ends with slash, append wellKnownPath without leading slash
- Eliminates need for substring() by using the slash logic more elegantly

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
2025-07-04 08:01:55 -04:00
codegen-sh[bot]
2f06ae9e48 Fix OIDC login failures with Base64 avatar URLs (#9501) 2025-06-28 10:47:51 -04:00
codegen-sh[bot]
879c568a2c Upgrade Prettier to v3.6.2 (#9500)
* Upgrade Prettier to v3.6.2 and eslint-plugin-prettier to v5.5.1

- Upgraded prettier from ^2.8.8 to ^3.6.2 (latest version)
- Upgraded eslint-plugin-prettier from ^4.2.1 to ^5.5.1 for compatibility
- Applied automatic formatting changes from new Prettier version
- All existing ESLint and Prettier configurations remain compatible

* Applied automatic fixes

* Trigger CI

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-06-28 10:22:28 -04:00
Tom Moor
2e53145532 fix: Notion API timed out during import (#9498) 2025-06-28 09:50:32 -04:00
Tom Moor
f6f831f3f6 fix: Enable PKCE if OIDC discovery endpoint supports it (#9478)
* fix: Enable PKCE if OIDC discovery endpoint supports it

* fix: Ensure code_verifier is passed through state

* facepalm
2025-06-27 11:06:45 -04:00
Tom Moor
3700342b35 fix: Not correctly catching linked databases (#9497) 2025-06-27 13:50:36 +00:00
Hemachandar
a3b3e9e0be Use Retry-After header for Notion rate-limit retries (#9467) 2025-06-18 16:39:58 -04:00
Tom Moor
0536c108eb fix: Login via email does not properly redirect to desktop app (#9440) 2025-06-12 21:12:58 -04:00
Tom Moor
ca0e37063c fix: Sporadic rate limiting errors from Notion (#9436) 2025-06-12 16:20:32 -04:00
Hemachandar
c9f25546e8 fix: Handle Notion linked database errors (#9429) 2025-06-11 09:10:00 -04:00
Hemachandar
554c7a8111 Handle OAuth error in Linear callback (#9419) 2025-06-10 08:46:52 -04:00
Hemachandar
6cf230963e Show integrations breadcrumb for Linear scene (#9418) 2025-06-10 08:10:54 -04:00
codegen-sh[bot]
f3b4640c7a Update Switch component onChange handler to use boolean callback (#9385)
* Update Switch component onChange handler to use boolean callback

- Remove synthetic event handling from Switch component
- Update onChange signature to (checked: boolean) => void
- Update all call points across the codebase:
  - PublicAccess.tsx: Updated handlers for indexing, showLastModified, and published switches
  - Security.tsx: Created individual handlers for all security preferences
  - Preferences.tsx: Created individual handlers for user preferences
  - CollectionForm.tsx: Added createSwitchRegister helper for react-hook-form compatibility
  - TemplatizeDialog: Updated publish handler
  - DocumentMenu.tsx: Added handlers for embeds and full-width toggles
  - Search.tsx: Updated SearchTitlesFilter handler
  - Application.tsx: Added createSwitchRegister helper
  - Details.tsx: Updated public branding handler
  - Features.tsx: Created individual handlers for seamless edit and commenting
  - OAuthClientForm.tsx: Added createSwitchRegister helper

- Maintained backward compatibility with react-hook-form
- Improved type safety and code clarity

* Fix ESLint floating promise errors

- Add void operator to onChange call in CollectionForm.tsx
- Add void operator to document.save call in DocumentMenu.tsx

These changes fix the @typescript-eslint/no-floating-promises errors
while maintaining the existing functionality.

* Fix Switch component onChange handlers in remaining files

- Updated DocumentCopy.tsx handlers to use boolean parameter
- Updated Notifications.tsx to use closure pattern for event types
- Updated SlackListItem.tsx to use closure pattern for event names
- All TypeScript errors resolved

* Refactor createSwitchRegister into utils/forms

- Created shared utility function in app/utils/forms.ts
- Removed duplicate implementations from CollectionForm, Application, and OAuthClientForm
- Updated all usage points to use the shared utility
- Improved TypeScript typing with Record<string, unknown>
- Fixed imports and removed unused variables
- Maintained existing functionality while reducing code duplication

* Fix TypeScript errors in createSwitchRegister utility

- Updated generic constraint from Record<string, unknown> to FieldValues
- Added Path import from react-hook-form for proper type safety
- Fixed parameter type from keyof TFormData to Path<TFormData>
- Improved type compatibility with react-hook-form's UseFormRegister

Resolves TypeScript compilation errors in CI pipeline.

* Remove unnecessary handlePublishChange callbacks

- Removed handlePublishChange wrapper in DocumentCopy.tsx
- Removed handlePublishChange wrapper in TemplatizeDialog/index.tsx
- Updated Switch components to use setPublish directly
- Simplified code by leveraging boolean callback from Switch component

Since Switch now passes boolean directly, no need for intermediate callbacks.

* Address review feedback: simplify callbacks and fix fullWidth behavior

1. DocumentCopy.tsx:
   - Remove handleRecursiveChange callback wrapper
   - Use setRecursive directly with Switch component

2. DocumentMenu.tsx:
   - Add void user.save() to persist user preference
   - Add document.fullWidth = checked for optimistic update behavior

Both changes leverage the boolean callback from Switch component properly.

* Update Security.tsx

* i18n

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-06-08 10:59:16 -04:00
Hemachandar
a85fec57cc chore: Cleanup unfurl temporary backward compatibility (#9406) 2025-06-08 09:24:32 -04:00
codegen-sh[bot]
62a388fc3b Update import button to show "Uploading…" state during file upload (#9365)
* Update import button to show 'Uploading…' state during file upload

- Update DropToImport component to show 'Uploading…' text and disable button during import
- Update Notion ImportDialog to show 'Uploading…' text during submission
- Improves user feedback during import operations

* Move ellipsis character out of translated strings

- Separate ellipsis from 'Uploading' translation to improve i18n
- Use string concatenation: t('Uploading') + '…' instead of t('Uploading…')

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
2025-06-01 11:41:22 -04:00
codegen-sh[bot]
758d4edbb9 Upgrade @typescript-eslint dependencies to v8.33.0 (#9363)
* Upgrade @typescript-eslint dependencies from v6.21.0 to v8.33.0

- Updated @typescript-eslint/eslint-plugin from ^6.21.0 to ^8.33.0
- Updated @typescript-eslint/parser from ^6.21.0 to ^8.33.0
- Tested linting functionality to ensure compatibility
- This brings the latest TypeScript ESLint features and bug fixes

* lint

* tsc

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-06-01 11:01:15 -04:00
codegen-sh[bot]
f284a27941 feat: Add OIDC well-known endpoint discovery support (#9308)
* feat: Add OIDC well-known endpoint discovery support

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-27 07:56:02 -04:00
Hemachandar
82b5b87440 fix: Skip fetching children for unsupported Notion blocks (#9289)
* fix: Skip fetching children for unsupported Notion blocks

* better naming
2025-05-23 17:17:05 -04:00
codegen-sh[bot]
d2aba1de96 feat: Add POST method option to redirectOnClient (#9228)
* feat: Add POST method option to redirectOnClient helper

* Applied automatic fixes

* fix: Add missing closing HTML tag in redirectOnClient GET method

* fix: Use lodash escape for form field values to prevent XSS

* Applied automatic fixes

* fix: Add missing lodash/escape import

* Applied automatic fixes

* fix: Escape all URLs in redirectOnClient function

* Update index.ts

* fix: CSP

* Refactor CSP middleware

* docs, only use for email signin

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-05-17 09:06:32 -04:00
Tom Moor
08b7c11461 Normalize Collection.findByPk (#9193) 2025-05-14 00:05:45 -04:00
Adam Roe
79fe73fbe1 fix: fall back to id_token when OIDC userinfo endpoint is sparse (#9172)
* Fall back to id_token if profile does not contain username or email

* More comments

* Add error handling to id_token decode

* simplify username fallback logic using nullish coalescing

Co-authored-by: Tom Moor <tom.moor@gmail.com>

* make id_token decoding more tolerant of malformed or invalid tokens

---------

Co-authored-by: Tom Moor <tom.moor@gmail.com>
2025-05-13 21:06:14 -04:00