Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
cognito: update tsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
fwang committed Sep 20, 2024
1 parent 8456099 commit 734edb0
Showing 1 changed file with 34 additions and 9 deletions.
43 changes: 34 additions & 9 deletions platform/src/components/aws/cognito-user-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,17 +528,17 @@ export class CognitoUserPool extends Component implements Link.Linkable {
triggers.customEmailSender === undefined
? undefined
: {
lambdaArn: createTrigger("customEmailSender")!,
lambdaVersion: "V1_0",
},
lambdaArn: createTrigger("customEmailSender")!,
lambdaVersion: "V1_0",
},
customMessage: createTrigger("customMessage"),
customSmsSender:
triggers.customSmsSender === undefined
? undefined
: {
lambdaArn: createTrigger("customSmsSender")!,
lambdaVersion: "V1_0",
},
lambdaArn: createTrigger("customSmsSender")!,
lambdaVersion: "V1_0",
},
defineAuthChallenge: createTrigger("defineAuthChallenge"),
postAuthentication: createTrigger("postAuthentication"),
postConfirmation: createTrigger("postConfirmation"),
Expand All @@ -548,9 +548,9 @@ export class CognitoUserPool extends Component implements Link.Linkable {
triggers.preTokenGeneration === undefined
? undefined
: {
lambdaArn: createTrigger("preTokenGeneration")!,
lambdaVersion: triggers.preTokenGenerationVersion,
},
lambdaArn: createTrigger("preTokenGeneration")!,
lambdaVersion: triggers.preTokenGenerationVersion,
},
userMigration: createTrigger("userMigration"),
verifyAuthChallengeResponse: createTrigger(
"verifyAuthChallengeResponse",
Expand Down Expand Up @@ -627,6 +627,31 @@ export class CognitoUserPool extends Component implements Link.Linkable {
* ```ts
* userPool.addClient("Web");
* ```
*
* And if you are using an identity provider.
*
* ```js title="sst.config.ts"
* const provider = userPool.addIdentityProvider("MyProvider", {
* type: "oidc",
* details: {
* authorize_scopes: "email profile",
* client_id: "your-client-id",
* client_secret: "your-client-secret"
* },
* });
* ```
* :::tip
* Don't hardcode the provider name. Reference it from the `providerName` property.
* :::
*
* Make sure to pass in the provider's `providerName` instead of hardcoding it. This
* ensures the client is created after the provider.
*
* ```ts
* userPool.addClient("Web", {
* providers: [provider.providerName]
* });
* ```
*/
public addClient(name: string, args?: CognitoUserPoolClientArgs) {
// Note: Referencing an existing client will be implemented in the future:
Expand Down

0 comments on commit 734edb0

Please sign in to comment.