mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
fix(api): 🐛 Fix incorrect OAuth2 linking logic
This commit is contained in:
parent
2db4f25ba6
commit
d4e1c0d95d
|
|
@ -150,7 +150,7 @@ export class OAuthManager {
|
|||
const { flow, userInfo } = oidcFlowData;
|
||||
|
||||
// Check if userId is equal to application.clientId
|
||||
if ((flow.application?.clientId ?? "") !== userId) {
|
||||
if (!flow.application?.clientId.startsWith(userId)) {
|
||||
return response(null, 302, {
|
||||
Location: `${config.http.base_url}${
|
||||
config.frontend.routes.home
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ export const schemas = {
|
|||
query: z.object({
|
||||
issuer: z.string(),
|
||||
client_id: z.string().optional(),
|
||||
redirect_uri: z.string().url().optional(),
|
||||
scope: z.string().optional(),
|
||||
response_type: z.enum(["code"]).optional(),
|
||||
}),
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue