-
Notifications
You must be signed in to change notification settings - Fork 4
425 add telegram login alongside discord authentication #426
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
Behzad-rabiei
merged 13 commits into
main
from
425-add-telegram-login-alongside-discord-authentication
Jan 29, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
aa7278e
chore: update togethercrew.dev/db package
Behzad-rabiei 620203a
chore: update togethercrew.dev/db package
Behzad-rabiei 66917eb
chore: update togethercrew.dev/db package
Behzad-rabiei 3bfdbe4
refactor: modify Discord authentication logic to support the new user…
Behzad-rabiei c0cfda1
feat: implement telegram auth api
Behzad-rabiei b2f75cf
feat: update patch /platforms/:platformid route to adjust latest user…
Behzad-rabiei b14ce86
feat: update the utility to handle role assignments based on the new …
Behzad-rabiei 12bb134
style: format the code
Behzad-rabiei 0991e9a
refactor: remove no needed code
Behzad-rabiei 8c1a69a
style: format the code
Behzad-rabiei 55ce2a0
chore: develop migration script
Behzad-rabiei 396b28f
fix: fix bugs
Behzad-rabiei 929038c
fix: fix bugs
Behzad-rabiei 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| { | ||
| "lastRun": "1720532975152-add-isfetchingintialdata.ts", | ||
| "lastRun": "1738072787796-update-user-documents-for-telegram-login.ts", | ||
| "migrations": [ | ||
| { | ||
| "title": "1720532975152-add-isfetchingintialdata.ts", | ||
| "timestamp": 1720533282435 | ||
| "title": "1738072787796-update-user-documents-for-telegram-login.ts", | ||
| "timestamp": 1738073593695 | ||
| } | ||
| ] | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
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.
🛠️ Refactor suggestion
Add explicit state validation before proceeding with OAuth.
While the code handles the state parameter, it should explicitly validate that both states exist and match before proceeding with the OAuth callback.
Consider this improvement:
const code = req.query.code as string; const returnedState = req.query.state as string; const storedState = req.session.state; + if (!returnedState || !storedState || returnedState !== storedState) { + throw new Error('Invalid state parameter'); + } const redirectUrl = await discordServices.authService.handleOAuthCallback({📝 Committable suggestion