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:
parent
c0617f159d
commit
be1b570691
2 changed files with 18 additions and 1 deletions
|
@ -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,
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Add table
Reference in a new issue