Repository navigation
feat(oauth): reading_history scope on the consent page and API settings #7325
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
base: main
Are you sure you want to change the base?
Changes from all commits
ec198cd
506e6fc
9292fb9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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']; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: Reviewed by AI.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made it opt-in in 9292fb9: |
||
|
|
||
| const scopeDescriptions: Record<string, string> = { | ||
| openid: 'Know who you are on daily.dev', | ||
|
|
@@ -31,6 +31,8 @@ const scopeDescriptions: Record<string, string> = { | |
| 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<string[]>([]); | ||
| const [declinedScopes, setDeclinedScopes] = useState<string[]>([ | ||
| 'reading_history', | ||
| ]); | ||
| const [consentError, setConsentError] = useState<string>(); | ||
| const clientId = getFirstQueryParam(query.client_id); | ||
| const requestedScopes = (getFirstQueryParam(query.scope) ?? '') | ||
|
|
||
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.
Blocking (one-line fix): the new scope is missing from
scopeLabelsinpackages/webapp/components/settings/OAuthApps.tsx, which only labelsreadandwrite. The Connected apps list builds each app's scope summary from that map and drops any scope without a label, so an app granted reading history still shows only "Read, Write". Users review and revoke access on that page, so it should show this scope. Please add a label in this PR, e.g.reading_history: 'Reading history'.Reviewed by AI.
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.
Fixed in 9292fb9:
scopeLabelsnow hasreading_history: 'Reading history', so Connected apps shows it.