0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-31 22:51:25 -05:00

chore: add comments

This commit is contained in:
Gao Sun 2024-06-17 12:06:52 +08:00
parent c0617f159d
commit be1b570691
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
2 changed files with 18 additions and 1 deletions

View file

@ -10,6 +10,9 @@ export const accessTokenEndpoint = 'https://oauth2.googleapis.com/token';
export const userInfoEndpoint = 'https://openidconnect.googleapis.com/v1/userinfo';
export const scope = 'openid profile email';
// Instead of defining the metadata in the connector, we reuse the metadata from the connector-kit.
// This is not the normal practice, but Google One Tap is a special case.
// @see {@link GoogleConnector} for more information.
export const defaultMetadata: ConnectorMetadata = {
id: GoogleConnector.factoryId,
target: GoogleConnector.target,

View file

@ -81,6 +81,11 @@ export type SocialConnector = BaseConnector<ConnectorType.Social> & {
validateSamlAssertion?: ValidateSamlAssertion;
};
/**
* The configuration object for Google One Tap.
*
* @see {@link https://developers.google.com/identity/gsi/web/reference/html-reference | Sign In With Google HTML API reference}
*/
export type GoogleOneTapConfig = {
isEnabled?: boolean;
autoSelect?: boolean;
@ -95,7 +100,16 @@ export const googleOneTapConfigGuard = z.object({
itpSupport: z.boolean().optional(),
}) satisfies ToZodObject<GoogleOneTapConfig>;
/** An object that contains the configuration for the official Google connector. */
/**
* An object that contains the configuration for the official Google connector.
*
* @remarks
* Unlike other connectors, the Google connector supports Google One Tap which needs additional
* configuration and special handling in our system. So we put the constants and configuration
* in this package for reusability, rather than hardcoding them in our system.
*
* Other connectors should not follow this pattern unless there is a strong reason to do so.
*/
export const GoogleConnector = Object.freeze({
/** The target of Google connectors. */
target: 'google',