-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Migrate to better auth #637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
102 commits
Select commit
Hold shift + click to select a range
8de7e60
Add consent and account_select to Microsoft Entra
edulelis 731a067
Merge pull request #613 from edulelis/staging-test-select-account-prompt
edulelis 0d93f19
Simple consent test
edulelis 19390fd
Merge pull request #614 from edulelis/staging-test-select-account-prompt
edulelis 4bf10c0
Enable AuthJS debug
edulelis 9b65228
Merge pull request #619 from edulelis/staging-test-select-account-prompt
edulelis fddf234
Set logger, update error page
edulelis 523e85f
Remove unused import
edulelis a665d97
Merge pull request #620 from edulelis/staging-test-select-account-prompt
edulelis 0b61cb2
Add temporary bypass
edulelis 5132460
Merge pull request #621 from edulelis/staging-test-select-account-prompt
edulelis 05814ed
Separate google/microsoft-entra-id logic on jwt
edulelis df93d75
Merge pull request #622 from edulelis/staging-test-select-account-prompt
edulelis fe105f9
Allow dangerous linking
edulelis 7cb0e72
Merge pull request #623 from edulelis/staging-test-select-account-prompt
edulelis e2f87d8
Log user, account
edulelis 33ccd37
Merge pull request #624 from edulelis/staging-test-select-account-prompt
edulelis 7ab95b7
Update token expiry logic
edulelis 7b5186a
Merge pull request #625 from edulelis/staging-test-select-account-prompt
edulelis cf47be1
Skip checks as test
edulelis b2a4d5a
Merge pull request #626 from edulelis/staging-test-select-account-prompt
edulelis 7a5120b
Add missing authorization url
edulelis 9d3cc73
Merge pull request #627 from edulelis/staging-test-select-account-prompt
edulelis 0970d39
Copy google provider props
edulelis 8968ef9
Merge pull request #628 from edulelis/staging-test-select-account-prompt
edulelis 02e7c07
Test with reduced scope
edulelis 1160cd2
Merge pull request #629 from edulelis/staging-test-select-account-prompt
edulelis a035c32
better-auth migration
edulelis d3cd238
Merge branch 'staging' of github.com:elie222/inbox-zero into migrate-…
edulelis e4c18f9
Merge branch 'main' into staging
elie222 11684ca
Merge branch 'staging' of github.com:elie222/inbox-zero into migrate-…
edulelis 0dd2b85
Bugfixes. Update readme. Migration
edulelis 6cc9e42
Simplify login try/catch
edulelis 9b7656c
Merge pull request #632 from edulelis/migrate-to-better-auth
edulelis 78f92ee
Update lockfile
edulelis a53fcbe
Merge pull request #633 from edulelis/migrate-to-better-auth
edulelis cdb4ea0
Fix expiration type
edulelis 191185c
Merge pull request #634 from edulelis/migrate-to-better-auth
edulelis bdb31cc
Uncomment outlook scopes
edulelis 44fbb80
Merge pull request #635 from edulelis/migrate-to-better-auth
edulelis 2cd1b55
Reduce diff in schema
edulelis 6ec1175
Merge pull request #636 from edulelis/migrate-to-better-auth
edulelis 95a4bde
Use old redirect URI. Remove extra envs
edulelis 172295f
Update migration in place. Update schema
edulelis 9b58562
Update migration
edulelis 4709315
Merge pull request #638 from edulelis/migrate-to-better-auth
edulelis 61e5552
Fix typo in redirect uri param
edulelis 6a515d9
Merge pull request #639 from edulelis/migrate-to-better-auth
edulelis 6a61319
Update base paths
edulelis 44ba462
Merge pull request #640 from edulelis/migrate-to-better-auth
edulelis 05608b8
Enable logging. Add trusted origins
edulelis 598d302
Merge pull request #641 from edulelis/migrate-to-better-auth
edulelis 2c700dd
Remove custom redirectURI
edulelis 80bbf29
Merge pull request #642 from edulelis/migrate-to-better-auth
edulelis 2e0a05f
logs with patched pkg
edulelis b2af57a
Update scopes. Add baseURL
edulelis 3ba416e
Merge pull request #643 from edulelis/migrate-to-better-auth
edulelis a542e91
Delete patches
edulelis 14eddb7
Restore lockfile
edulelis 8545245
Merge pull request #644 from edulelis/migrate-to-better-auth
edulelis a34c7d0
Update package.json and lockfile
edulelis da16d07
Merge pull request #646 from edulelis/migrate-to-better-auth
edulelis 781b297
Log levels and keep verification for debugging
edulelis f10918c
Merge pull request #647 from edulelis/migrate-to-better-auth
edulelis c4e14d8
Disable ip tracking. Log debug as info
edulelis c308581
Merge pull request #649 from edulelis/migrate-to-better-auth
edulelis e793528
Cookie domain setup
edulelis e7851db
Merge pull request #651 from edulelis/migrate-to-better-auth
edulelis f4cc018
Update cooki settings. Add cookie env
edulelis 4a791d5
Merge pull request #653 from edulelis/migrate-to-better-auth
edulelis f59168b
Remove auto logout
edulelis 1ffefaa
Merge pull request #654 from edulelis/migrate-to-better-auth
edulelis f2cefa6
Test simplified auth flow
edulelis 243a6a1
Merge pull request #655 from edulelis/migrate-to-better-auth
edulelis 59053e4
Major better-auth refactor
edulelis 00be0b5
Remove unused props
edulelis 4dee238
PR cleanup
edulelis 0f23b94
Merge pull request #658 from edulelis/migrate-to-better-auth
edulelis 4bc0674
Merge branch 'main' of github.com:elie222/inbox-zero into migrate-to-…
edulelis 15d4dab
Cleanup unused props. Add linking on update
edulelis 42f724b
PR feedback
edulelis a800c2c
PR Feedback
edulelis b5468fe
Merge pull request #662 from edulelis/migrate-to-better-auth
edulelis e35609f
Fix tests
edulelis 6d539c3
Initial commit move to folder action
edulelis af8992f
Remove unused imports
edulelis 2c93da7
Merge branch 'main' of github.com:elie222/inbox-zero into move-to-fol…
edulelis bfe6890
Type fixes after move to folder action
edulelis 2da5a75
Merge branch 'main' of github.com:elie222/inbox-zero into move-to-fol…
edulelis 26bdc0a
Merge branch 'main' of github.com:elie222/inbox-zero into merge-main-…
edulelis 060753f
Update microsoft provider
edulelis 175e073
Merge pull request #669 from edulelis/merge-main-staging
edulelis f5d775e
Merge branch 'staging' of github.com:elie222/inbox-zero into move-to-…
edulelis 8e1aa36
Schema fixes. Add move to folder migration. PR feedback fixes
edulelis e98db3e
Merge pull request #668 from edulelis/move-to-folder-action
edulelis 6eb4fd5
Merge branch 'main' of github.com:elie222/inbox-zero into migrate-to-…
edulelis 5e7efc6
Update logs
edulelis 4f66b97
outlook security
elie222 8f8534f
fix github action tests
elie222 3cd6c9b
PR feedback
edulelis 6692fb7
Merge branch 'staging' of github.com:elie222/inbox-zero into migrate-…
edulelis bd4ae64
PR feedback
edulelis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import { describe, it, expect } from "vitest"; | ||
| import { escapeODataString } from "@/utils/outlook/odata-escape"; | ||
|
|
||
| describe("OData String Escaping", () => { | ||
| it("should escape single quotes by doubling them", () => { | ||
| expect(escapeODataString("O'Brien")).toBe("O''Brien"); | ||
| expect(escapeODataString("test' or 1=1 --")).toBe("test'' or 1=1 --"); | ||
| expect(escapeODataString("it's a test")).toBe("it''s a test"); | ||
| }); | ||
|
|
||
| it("should handle strings without quotes", () => { | ||
| expect(escapeODataString("normal string")).toBe("normal string"); | ||
| expect(escapeODataString("test@example.com")).toBe("test@example.com"); | ||
| }); | ||
|
|
||
| it("should handle multiple quotes", () => { | ||
| expect(escapeODataString("'test'")).toBe("''test''"); | ||
| expect(escapeODataString("test's 'quoted' text")).toBe( | ||
| "test''s ''quoted'' text", | ||
| ); | ||
| }); | ||
|
|
||
| it("should handle empty strings", () => { | ||
| expect(escapeODataString("")).toBe(""); | ||
| }); | ||
|
|
||
| it("should handle non-string inputs safely", () => { | ||
| expect(escapeODataString(null as any)).toBe(""); | ||
| expect(escapeODataString(undefined as any)).toBe(""); | ||
| expect(escapeODataString(123 as any)).toBe(""); | ||
| }); | ||
|
|
||
| it("should prevent OData injection attacks", () => { | ||
| // Simulated malicious inputs | ||
| const maliciousEmail = "attacker@example.com' or subject eq 'sensitive"; | ||
| const escaped = escapeODataString(maliciousEmail); | ||
|
|
||
| // The escaped version should have doubled quotes | ||
| expect(escaped).toBe("attacker@example.com'' or subject eq ''sensitive"); | ||
|
|
||
| // When used in a filter, it should be safe | ||
| const filter = `from/emailAddress/address eq '${escaped}'`; | ||
| expect(filter).toBe( | ||
| "from/emailAddress/address eq 'attacker@example.com'' or subject eq ''sensitive'", | ||
| ); | ||
|
|
||
| // The filter should not allow breaking out of the string literal | ||
| // Check that there are no unescaped single quotes followed by " or " | ||
| // (All quotes should be doubled, so we shouldn't see a single quote followed by " or ") | ||
| expect(filter).toContain( | ||
| "attacker@example.com'' or subject eq ''sensitive", | ||
| ); | ||
| // Verify the malicious pattern has been neutralized | ||
| expect(filter).toBe( | ||
| "from/emailAddress/address eq 'attacker@example.com'' or subject eq ''sensitive'", | ||
| ); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would just inline as anyway if things will be added in the future it's unlikely in the next spot after move to folder