Gabriel Araújo
04/13/2022, 8:52 PMType 'Api<Record<string, ApiAuthorizer>>' is not assignable to type 'Api<Record<string, never>>'.
Type 'Record<string, ApiAuthorizer>' is not assignable to type 'Record<string, never>'.
'string' index signatures are incompatible.
Type 'ApiAuthorizer' is not assignable to type 'never'.
Type 'ApiUserPoolAuthorizer' is not assignable to type 'never'.ts(2322
for
return new sst.Api(this, "Api", {
authorizers: {
Authorizer: {
type: "jwt",
jwt: {
issuer: "<https://myorg.us.auth0.com>",
audience: ["UsGRQJJz5sDfPQDs6bhQ9Oc3hNISuVif"],
}
},
},
defaults: {
authorizer: "Authorizer",
authorizationScopes: ["user.id", "user.email"],
},
routes: {
"GET /notes": "src/list.main",
"POST /notes": {
function: "create.main",
authorizer: "Authorizer",
authorizationScopes: ["user.id", "user.email"],
}
},
});
Frank
Gabriel Araújo
04/13/2022, 8:56 PMsst.Api
Frank
new sst.Api
returns a Api<Generic> type with the authorizer names included in the Generic.Frank
Frank
thdxr
04/13/2022, 8:58 PMthdxr
04/13/2022, 8:58 PMGabriel Araújo
04/13/2022, 9:00 PMGabriel Araújo
04/13/2022, 9:00 PMprivate createApi(scope: <http://sst.App|sst.App>): sst.Api
To
private createApi(scope: <http://sst.App|sst.App>)