mirror of
https://github.com/versia-pub/server.git
synced 2025-12-07 08:48: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;
|
const { flow, userInfo } = oidcFlowData;
|
||||||
|
|
||||||
// Check if userId is equal to application.clientId
|
// Check if userId is equal to application.clientId
|
||||||
if ((flow.application?.clientId ?? "") !== userId) {
|
if (!flow.application?.clientId.startsWith(userId)) {
|
||||||
return response(null, 302, {
|
return response(null, 302, {
|
||||||
Location: `${config.http.base_url}${
|
Location: `${config.http.base_url}${
|
||||||
config.frontend.routes.home
|
config.frontend.routes.home
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,9 @@ export const schemas = {
|
||||||
query: z.object({
|
query: z.object({
|
||||||
issuer: z.string(),
|
issuer: z.string(),
|
||||||
client_id: z.string().optional(),
|
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