Skip to content

Commit

Permalink
Merge pull request #1030 from Fabio1988/patch-1
Browse files Browse the repository at this point in the history
Fixes telegram login widget
  • Loading branch information
TurtIeSocks authored Aug 10, 2024
2 parents 279b2c4 + adbaec6 commit 4b6b4ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion server/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ const startServer = async () => {
hidePoweredBy: true,
contentSecurityPolicy: {
directives: {
scriptSrc: ["'self'", 'https://cdn.jsdelivr.net'],
scriptSrc: [
"'self'",
'https://cdn.jsdelivr.net',
'https://telegram.org',
'https://static.cloudflareinsights.com',
],
frameSrc: ["'self'", 'https://*.telegram.org'],
workerSrc: ["'self'", 'blob:'],
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/auth/Telegram.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function TelegramWidget({ botName, authUrl }) {
React.useEffect(() => {
if (ref.current) {
const script = document.createElement('script')
script.src = 'https://telegram.org/js/telegram-widget.js?4'
script.src = 'https://telegram.org/js/telegram-widget.js?22'
script.setAttribute('data-telegram-login', botName)
script.setAttribute('data-auth-url', authUrl)
script.setAttribute(
Expand Down

0 comments on commit 4b6b4ae

Please sign in to comment.