Merge pull request #17898 from overleaf/tm-remove-twitter-login

Remove twitter login code and uninstall passport-twitter

GitOrigin-RevId: 928c877ef2a42d5881652cad7f9d563c7766fd36
This commit is contained in:
Thomas 2024-04-17 11:44:24 +02:00 committed by Copybot
parent d53a3e315e
commit 52e6ceef67
10 changed files with 1 additions and 119 deletions

83
package-lock.json generated
View file

@ -30932,23 +30932,6 @@
"node": ">= 0.4.0" "node": ">= 0.4.0"
} }
}, },
"node_modules/passport-oauth1": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/passport-oauth1/-/passport-oauth1-1.2.0.tgz",
"integrity": "sha512-Sv2YWodC6jN12M/OXwmR4BIXeeIHjjbwYTQw4kS6tHK4zYzSEpxBgSJJnknBjICA5cj0ju3FSnG1XmHgIhYnLg==",
"dependencies": {
"oauth": "0.9.x",
"passport-strategy": "1.x.x",
"utils-merge": "1.x.x"
},
"engines": {
"node": ">= 0.4.0"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/jaredhanson"
}
},
"node_modules/passport-oauth2": { "node_modules/passport-oauth2": {
"version": "1.6.1", "version": "1.6.1",
"resolved": "https://registry.npmjs.org/passport-oauth2/-/passport-oauth2-1.6.1.tgz", "resolved": "https://registry.npmjs.org/passport-oauth2/-/passport-oauth2-1.6.1.tgz",
@ -30984,18 +30967,6 @@
"node": ">= 0.4.0" "node": ">= 0.4.0"
} }
}, },
"node_modules/passport-twitter": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/passport-twitter/-/passport-twitter-1.0.4.tgz",
"integrity": "sha512-qvdauqCqCJJci82mJ9hZZQ6nAv7aSHV31svL8+9H7mRlDdXCdfU6AARQrmmJu3DRmv9fvIebM7zzxR7mVufN3A==",
"dependencies": {
"passport-oauth1": "1.x.x",
"xtraverse": "0.1.x"
},
"engines": {
"node": ">= 0.4.0"
}
},
"node_modules/patch-package": { "node_modules/patch-package": {
"version": "8.0.0", "version": "8.0.0",
"resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz", "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz",
@ -40293,15 +40264,6 @@
"resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz",
"integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==" "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg=="
}, },
"node_modules/xmldom": {
"version": "0.1.31",
"resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz",
"integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ==",
"deprecated": "Deprecated due to CVE-2021-21366 resolved in 0.5.0",
"engines": {
"node": ">=0.1"
}
},
"node_modules/xmlhttprequest": { "node_modules/xmlhttprequest": {
"version": "1.8.0", "version": "1.8.0",
"resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz",
@ -40339,17 +40301,6 @@
"node": ">=0.4" "node": ">=0.4"
} }
}, },
"node_modules/xtraverse": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/xtraverse/-/xtraverse-0.1.0.tgz",
"integrity": "sha512-MANQdlG2hl1nQobxz1Rv8hsS1RuBS0C1N6qTOupv+9vmfrReePdxhmB2ecYjvsp4stJ80HD7erjkoF1Hd/FK9A==",
"dependencies": {
"xmldom": "0.1.x"
},
"engines": {
"node": ">= 0.4.0"
}
},
"node_modules/y18n": { "node_modules/y18n": {
"version": "5.0.8", "version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
@ -43668,7 +43619,6 @@
"passport-local": "^1.0.0", "passport-local": "^1.0.0",
"passport-oauth2": "^1.5.0", "passport-oauth2": "^1.5.0",
"passport-orcid": "0.0.4", "passport-orcid": "0.0.4",
"passport-twitter": "^1.0.4",
"pug": "^3.0.1", "pug": "^3.0.1",
"pug-runtime": "^3.0.1", "pug-runtime": "^3.0.1",
"rate-limiter-flexible": "^2.4.1", "rate-limiter-flexible": "^2.4.1",
@ -52357,7 +52307,6 @@
"passport-local": "^1.0.0", "passport-local": "^1.0.0",
"passport-oauth2": "^1.5.0", "passport-oauth2": "^1.5.0",
"passport-orcid": "0.0.4", "passport-orcid": "0.0.4",
"passport-twitter": "^1.0.4",
"pdfjs-dist213": "npm:pdfjs-dist@2.13.216", "pdfjs-dist213": "npm:pdfjs-dist@2.13.216",
"pdfjs-dist401": "npm:pdfjs-dist@4.0.379", "pdfjs-dist401": "npm:pdfjs-dist@4.0.379",
"pirates": "^4.0.1", "pirates": "^4.0.1",
@ -71697,16 +71646,6 @@
"passport-strategy": "1.x.x" "passport-strategy": "1.x.x"
} }
}, },
"passport-oauth1": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/passport-oauth1/-/passport-oauth1-1.2.0.tgz",
"integrity": "sha512-Sv2YWodC6jN12M/OXwmR4BIXeeIHjjbwYTQw4kS6tHK4zYzSEpxBgSJJnknBjICA5cj0ju3FSnG1XmHgIhYnLg==",
"requires": {
"oauth": "0.9.x",
"passport-strategy": "1.x.x",
"utils-merge": "1.x.x"
}
},
"passport-oauth2": { "passport-oauth2": {
"version": "1.6.1", "version": "1.6.1",
"resolved": "https://registry.npmjs.org/passport-oauth2/-/passport-oauth2-1.6.1.tgz", "resolved": "https://registry.npmjs.org/passport-oauth2/-/passport-oauth2-1.6.1.tgz",
@ -71732,15 +71671,6 @@
"resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz",
"integrity": "sha1-tVOaqPwiWj0a0XlHbd8ja0QPUuQ=" "integrity": "sha1-tVOaqPwiWj0a0XlHbd8ja0QPUuQ="
}, },
"passport-twitter": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/passport-twitter/-/passport-twitter-1.0.4.tgz",
"integrity": "sha512-qvdauqCqCJJci82mJ9hZZQ6nAv7aSHV31svL8+9H7mRlDdXCdfU6AARQrmmJu3DRmv9fvIebM7zzxR7mVufN3A==",
"requires": {
"passport-oauth1": "1.x.x",
"xtraverse": "0.1.x"
}
},
"patch-package": { "patch-package": {
"version": "8.0.0", "version": "8.0.0",
"resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz", "resolved": "https://registry.npmjs.org/patch-package/-/patch-package-8.0.0.tgz",
@ -78647,11 +78577,6 @@
"resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz",
"integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==" "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg=="
}, },
"xmldom": {
"version": "0.1.31",
"resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.31.tgz",
"integrity": "sha512-yS2uJflVQs6n+CyjHoaBmVSqIDevTAWrzMmjG1Gc7h1qQ7uVozNhEPJAwZXWyGQ/Gafo3fCwrcaokezLPupVyQ=="
},
"xmlhttprequest": { "xmlhttprequest": {
"version": "1.8.0", "version": "1.8.0",
"resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz",
@ -78680,14 +78605,6 @@
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
}, },
"xtraverse": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/xtraverse/-/xtraverse-0.1.0.tgz",
"integrity": "sha512-MANQdlG2hl1nQobxz1Rv8hsS1RuBS0C1N6qTOupv+9vmfrReePdxhmB2ecYjvsp4stJ80HD7erjkoF1Hd/FK9A==",
"requires": {
"xmldom": "0.1.x"
}
},
"y18n": { "y18n": {
"version": "5.0.8", "version": "5.0.8",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",

View file

@ -19,7 +19,7 @@ const GroupPolicySchema = new Schema(
// User can't have a Google SSO account, nor can they link it to their account // User can't have a Google SSO account, nor can they link it to their account
userCannotHaveGoogleSSO: Boolean, userCannotHaveGoogleSSO: Boolean,
// User can't have other third-party SSO (e.g. Twitter/ORCID/IEEE) active on their account, nor can they link it to their account // User can't have other third-party SSO (e.g. ORCID/IEEE) active on their account, nor can they link it to their account
userCannotHaveOtherThirdPartySSO: Boolean, userCannotHaveOtherThirdPartySSO: Boolean,
}, },
{ minimize: false } { minimize: false }

View file

@ -696,7 +696,6 @@
"login_count": "", "login_count": "",
"login_to_accept_invitation": "", "login_to_accept_invitation": "",
"login_with_service": "", "login_with_service": "",
"login_with_service_will_stop_working_soon": "",
"logs_and_output_files": "", "logs_and_output_files": "",
"looking_multiple_licenses": "", "looking_multiple_licenses": "",
"looks_like_youre_at": "", "looks_like_youre_at": "",

View file

@ -232,11 +232,6 @@ function SSOLinkingWidgetContainer({
service: subscription.provider.name, service: subscription.provider.name,
})}.` })}.`
break break
case 'twitter':
description = t('login_with_service_will_stop_working_soon', {
service: subscription.provider.name,
})
break
case 'orcid': case 'orcid':
description = t('oauth_orcid_description') description = t('oauth_orcid_description')
break break

View file

@ -7,20 +7,11 @@ import IEEELogo from '../../../../shared/svgs/ieee-logo'
import GoogleLogo from '../../../../shared/svgs/google-logo' import GoogleLogo from '../../../../shared/svgs/google-logo'
import OrcidLogo from '../../../../shared/svgs/orcid-logo' import OrcidLogo from '../../../../shared/svgs/orcid-logo'
import LinkingStatus from './status' import LinkingStatus from './status'
import Icon from '../../../../shared/components/icon'
const providerLogos: { readonly [p: string]: JSX.Element } = { const providerLogos: { readonly [p: string]: JSX.Element } = {
collabratec: <IEEELogo />, collabratec: <IEEELogo />,
google: <GoogleLogo />, google: <GoogleLogo />,
orcid: <OrcidLogo />, orcid: <OrcidLogo />,
twitter: (
<Icon
type="exclamation-triangle"
fw
className="text-warning"
style={{ fontSize: '32px', width: '40px' }}
/>
),
} }
type SSOLinkingWidgetProps = { type SSOLinkingWidgetProps = {

View file

@ -24,7 +24,6 @@ export function setDefaultMeta() {
window.metaAttributesCache.set('ol-thirdPartyIds', { window.metaAttributesCache.set('ol-thirdPartyIds', {
collabratec: 'collabratec-id', collabratec: 'collabratec-id',
google: 'google-id', google: 'google-id',
twitter: 'twitter-id',
}) })
window.metaAttributesCache.set('ol-oauthProviders', { window.metaAttributesCache.set('ol-oauthProviders', {
@ -50,11 +49,6 @@ export function setDefaultMeta() {
name: 'ORCID', name: 'ORCID',
linkPath: '/auth/orcid', linkPath: '/auth/orcid',
}, },
twitter: {
hideWhenNotLinked: true,
name: 'Twitter',
linkPath: '/auth/twitter',
},
}) })
window.metaAttributesCache.delete('integrationLinkingWidgets') window.metaAttributesCache.delete('integrationLinkingWidgets')
window.metaAttributesCache.delete('referenceLinkingWidgets') window.metaAttributesCache.delete('referenceLinkingWidgets')

View file

@ -1042,7 +1042,6 @@
"login_to_accept_invitation": "Log in to accept invitation", "login_to_accept_invitation": "Log in to accept invitation",
"login_to_overleaf": "Log in to Overleaf", "login_to_overleaf": "Log in to Overleaf",
"login_with_service": "Log in with __service__", "login_with_service": "Log in with __service__",
"login_with_service_will_stop_working_soon": "Login with __service__ will stop working soon. If you log in with __service__, please take a moment to set up another SSO provider or a password.",
"logs_and_output_files": "Logs and output files", "logs_and_output_files": "Logs and output files",
"longer_compile_timeout": "Longer <0>compile timeout</0>", "longer_compile_timeout": "Longer <0>compile timeout</0>",
"looking_multiple_licenses": "Looking for multiple licenses?", "looking_multiple_licenses": "Looking for multiple licenses?",

View file

@ -147,7 +147,6 @@
"passport-local": "^1.0.0", "passport-local": "^1.0.0",
"passport-oauth2": "^1.5.0", "passport-oauth2": "^1.5.0",
"passport-orcid": "0.0.4", "passport-orcid": "0.0.4",
"passport-twitter": "^1.0.4",
"pug": "^3.0.1", "pug": "^3.0.1",
"pug-runtime": "^3.0.1", "pug-runtime": "^3.0.1",
"rate-limiter-flexible": "^2.4.1", "rate-limiter-flexible": "^2.4.1",

View file

@ -34,11 +34,6 @@ const mockOauthProviders = {
name: 'ORCID', name: 'ORCID',
linkPath: '/auth/orcid', linkPath: '/auth/orcid',
}, },
twitter: {
hideWhenNotLinked: true,
name: 'Twitter',
linkPath: '/auth/twitter',
},
} }
describe('<LinkingSection />', function () { describe('<LinkingSection />', function () {
@ -89,8 +84,6 @@ describe('<LinkingSection />', function () {
expect(helpLink.getAttribute('href')).to.equal('/blog/434') expect(helpLink.getAttribute('href')).to.equal('/blog/434')
const linkButton = screen.getByRole('link', { name: 'Link' }) const linkButton = screen.getByRole('link', { name: 'Link' })
expect(linkButton.getAttribute('href')).to.equal('/auth/orcid?intent=link') expect(linkButton.getAttribute('href')).to.equal('/auth/orcid?intent=link')
expect(screen.queryByText('Twitter')).to.not.exist
}) })
it('shows SSO error message', async function () { it('shows SSO error message', async function () {

View file

@ -22,11 +22,6 @@ const mockOauthProviders = {
name: 'ORCID', name: 'ORCID',
linkPath: '/auth/orcid', linkPath: '/auth/orcid',
}, },
twitter: {
hideWhenNotLinked: true,
name: 'Twitter',
linkPath: '/auth/twitter',
},
} }
describe('SSOContext', function () { describe('SSOContext', function () {