add oauth app connected

This commit is contained in:
lendry
2026-06-26 10:49:34 +03:00
parent d5e6b58955
commit b81c0cedbb
18 changed files with 838 additions and 59 deletions

View File

@@ -62,6 +62,20 @@ export function normalizeAuthorizeQuery(query: Record<string, unknown>): Normali
};
}
export function normalizeConsentQuery(query: Record<string, unknown>) {
const clientId = readString(query.clientId) ?? readString(query.client_id);
const scope = readString(query.scope) ?? 'openid profile';
const redirectUri = readString(query.redirectUri) ?? readString(query.redirect_uri);
const state = readString(query.state);
const nonce = readString(query.nonce);
if (!clientId) {
throw new BadRequestException('Укажите client_id');
}
return { clientId, scope, redirectUri, state, nonce };
}
export function normalizeTokenBody(body: Record<string, unknown>): NormalizedTokenBody {
const grantType = readString(body.grantType) ?? readString(body.grant_type);
const clientId = readString(body.clientId) ?? readString(body.client_id);