Weird one guys: Got an `Api` with a default author...
# help
b
Weird one guys: Got an
Api
with a default authorizer set up, but when I change one of the routes to use the
NONE
auth type it doesn't apply. Any ideas? Looked through the sst source for the construct and it looks like it should be picking up my change, but it just doesn't:
Copy code
new Api(this, "Api", {
            httpApi: {
                apiName: `${this.stage}-${scope.name}-auth`
            },
            routes: {
                "POST /access": {
                    handler: "src/auth/test.handler",
                    authorizationType: ApiAuthorizationType.NONE,
                },
            },
            defaultAuthorizationType: ApiAuthorizationType.JWT,
            defaultAuthorizer: new HttpUserPoolAuthorizer({
                userPool: this.cognito.cognitoUserPool!,
                userPoolClient: this.cognito.cognitoUserPoolClient!,
            })
Terminak:
Copy code
Rebuilding infrastructure...
No infrastructure changes detected
I can actually change the auth type to anything and it doesn't pick it up. Any ideas?
f
Hey @Brinsley, instead of
Copy code
routes: {
                "POST /access": {
                    handler: "src/auth/test.handler",
                    authorizationType: ApiAuthorizationType.NONE,
                },
            },
Try
Copy code
routes: {
                "POST /access": {
                    function: "src/auth/test.handler",
                    authorizationType: ApiAuthorizationType.NONE,
                },
            },
change
handler
to
function
b
Ooh
Now that you've said it I've seen it in the docs...
sigh
Been looking at those docs most of the evening