fix and update
This commit is contained in:
@@ -40,6 +40,7 @@ type FedcmAccountsResponse = {
|
||||
given_name?: string;
|
||||
email?: string;
|
||||
picture?: string;
|
||||
tel?: string;
|
||||
approved_clients?: string[];
|
||||
}>;
|
||||
};
|
||||
|
||||
@@ -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']
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user