diff --git a/packages/shared/src/lib/oauthApps.ts b/packages/shared/src/lib/oauthApps.ts index 2c455ba2f1b..7401ab561a0 100644 --- a/packages/shared/src/lib/oauthApps.ts +++ b/packages/shared/src/lib/oauthApps.ts @@ -33,6 +33,7 @@ export const OAUTH_SCOPES = [ 'offline_access', 'read', 'write', + 'reading_history', ]; export const MAX_OAUTH_APPS_PER_USER = 5; diff --git a/packages/webapp/components/settings/OAuthApps.tsx b/packages/webapp/components/settings/OAuthApps.tsx index 56e77d369ed..8ac2ee5f1d1 100644 --- a/packages/webapp/components/settings/OAuthApps.tsx +++ b/packages/webapp/components/settings/OAuthApps.tsx @@ -62,6 +62,7 @@ const OAUTH_REDIRECT_URIS_MAX_LENGTH = 2000; const scopeLabels: Record = { read: 'Read', write: 'Write', + reading_history: 'Reading history', }; const formatRelative = (value: Date): string => diff --git a/packages/webapp/pages/oauth/consent.tsx b/packages/webapp/pages/oauth/consent.tsx index 7575ed2b2d5..145fc0436c3 100644 --- a/packages/webapp/pages/oauth/consent.tsx +++ b/packages/webapp/pages/oauth/consent.tsx @@ -21,7 +21,7 @@ import { import { Checkbox } from '@dailydotdev/shared/src/components/fields/Checkbox'; import { noindexSeoProps } from '../../next-seo'; -const OPTIONAL_SCOPES = ['write', 'offline_access']; +const OPTIONAL_SCOPES = ['write', 'reading_history', 'offline_access']; const scopeDescriptions: Record = { openid: 'Know who you are on daily.dev', @@ -31,6 +31,8 @@ const scopeDescriptions: Record = { read: 'Read content on daily.dev, like feeds, posts, comments and search, and your personal data: profile, bookmarks, custom feeds, followed and blocked tags and sources, notifications, tech stack and experiences', write: 'Make changes on your behalf, like bookmarking posts and updating your feed settings', + reading_history: + "See the posts you've read on daily.dev and search your reading history", }; const getUrlHost = (value?: string): string | null => { @@ -49,7 +51,9 @@ const OAuthConsentPage = (): ReactElement => { const { query } = useRouter(); const { showLogin, user, isAuthReady } = useAuthContext(); const [isSubmitting, setIsSubmitting] = useState(false); - const [declinedScopes, setDeclinedScopes] = useState([]); + const [declinedScopes, setDeclinedScopes] = useState([ + 'reading_history', + ]); const [consentError, setConsentError] = useState(); const clientId = getFirstQueryParam(query.client_id); const requestedScopes = (getFirstQueryParam(query.scope) ?? '')