can anyone help with translating this to SST 1.0? ...
# help
s
can anyone help with translating this to SST 1.0? (within an
sst.Api
definition)
Copy code
defaultAuthorizer: new HttpUserPoolAuthorizer(
        'HttpUserPoolAuthorizer',
        props.cognitoAuth.cognitoUserPool!,
        {
          userPoolClients: [props.cognitoAuth.cognitoUserPoolClient!],
        }
      ),
I’m not sure how to get the issuer and audience from an
sst.Auth
instance
b
Looks like it's structured differently now:
Copy code
new Api(this, "Api", {
  authorizers: {
    myAuthorizer: {
      type: "user_pool",
      userPool: {
        id: userPool.userPoolId,
        clientIds: [userPoolClient.userPoolClientId],
      }
    },
  },
  defaults: {
    authorizer: "myAuthorizer",
    authorizationScopes: ["user.id", "user.email"],
  },
  routes: {
    "GET  /notes": "list.main",
    "POST /notes": "create.main",
  },
});
https://docs.serverless-stack.com/constructs/v1/Api#authorization Found this under Using Cognito User Poll as the JWT authorizer.
s
aha,
type: 'user_pool'
is what I was missing.. duh. thanks!