Is there a way to make `authorizationType` Optiona...
# help
s
Is there a way to make
authorizationType
Optional?
f
Hey @Sahan Amadoruge, it is optional, default to no authorization. You can specify
authorizationType
on a per-route basis. Is that what you mean?
a
Sahan, if you want to apply some of your own defaults to functions (such as JWT authorization), just write a function that takes definitions the way you want to define them and transforms into when SST needs. This power is the why of programmatic IaC instead of declarative (YAML). 🎉 😍
s
@Frank I've an API that can be access with and without authorization. But the issue was i cannot check jwt token when the
authorizationType
is set to "`NO`". What am i missing here?
@Adam Fanello Thank you.
f
Yeah, when
authorizationType
is set to
NO
, the route is pretty much public. You’d have to check the JWT token manually.
The request will not go through the authorizer.
s
Thank you