fix and update

This commit is contained in:
lendry
2026-07-01 16:26:43 +03:00
parent f7c01a3963
commit ee8aaf9889
9 changed files with 50 additions and 8 deletions

View File

@@ -105,15 +105,20 @@ export async function resolveFedcmEndpoints(core: CoreGrpcService, _req?: Reques
export function buildFedcmProviderConfig(endpoints: FedcmEndpoints) {
const base = normalizePublicBaseUrl(endpoints.issuer);
const front = normalizePublicBaseUrl(endpoints.frontendUrl);
return {
accounts_endpoint: `${base}/fedcm/accounts`,
client_metadata_endpoint: `${base}/fedcm/client_metadata`,
id_assertion_endpoint: `${base}/fedcm/id_assertion`,
login_url: endpoints.loginUrl,
branding: {
name: endpoints.projectName,
background_color: '#ffffff',
color: '#1f2430',
icons: [{ url: `${base}/favicon.ico`, size: 32 }]
icons: [
{ url: `${front}/icon.svg`, size: 40 },
{ url: `${base}/favicon.ico`, size: 32 }
]
}
};
}
@@ -135,7 +140,9 @@ export function buildFedcmDiscoverPayload(endpoints: FedcmEndpoints, enabled = t
configUrl: endpoints.configUrl,
webIdentityUrl: endpoints.webIdentityUrl,
accountsEndpoint: endpoints.accountsEndpoint,
loginUrl: endpoints.loginUrl
loginUrl: endpoints.loginUrl,
// Поля для navigator.credentials.get({ identity: { fields: [...] } }) на стороне RP (Chrome 132+).
suggestedFields: ['name', 'email', 'picture', 'tel']
};
}