-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
fix: Unable to log in with third-party apps without "Manage OAuth Apps" permission #32782
Changes from 1 commit
e87d8d5
cfcd0d2
f2aafc8
ce358c0
ae7e1c9
c1c2168
ba2c5e9
5a3401d
c3348d7
81ce26a
fefdf76
98f6a8f
0edac8e
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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
export interface IOAuthApps { | ||
_id: string; | ||
export interface IOAuthAppsInfo { | ||
clientId: string; | ||
name: string; | ||
} | ||
|
||
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. Personal pref: do we need this to be an interface? Can't we just 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. I agree, that will be better. |
||
export interface IOAuthApps extends IOAuthAppsInfo { | ||
_id: string; | ||
active: boolean; | ||
clientId: string; | ||
clientSecret: string; | ||
redirectUri: string; | ||
_createdAt: Date; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { ajv } from '../Ajv'; | ||
|
||
export type OauthAppsInfoParams = { clientId: string }; | ||
|
||
const oauthAppsInfoParamsSchema = { | ||
type: 'object', | ||
properties: { | ||
clientId: { | ||
type: 'string', | ||
}, | ||
matheusbsilva137 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
required: ['clientId'], | ||
additionalProperties: false, | ||
}; | ||
|
||
export const isOauthAppsInfoParams = ajv.compile<OauthAppsInfoParams>(oauthAppsInfoParamsSchema); |
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.
Add a projection since you're returning just clientId/name
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.
(this will imply updating the model typings for allowing the projection to go as the current method doesn't allow it)
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.
I added projection to the
findOneAuthAppByIdOrClientId
method of theIOAuthAppsModel
andOAuthAppsRaw
models. I hope I changed the code everywhere it was needed and didn't forget anything.