https://serverless-stack.com/ logo
#help
Title
# help
s

Sahan Amadoruge

02/02/2022, 9:58 AM
Is there a way to make
authorizationType
Optional?
f

Frank

02/02/2022, 4:02 PM
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

Adam Fanello

02/02/2022, 4:51 PM
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

Sahan Amadoruge

02/03/2022, 1:33 AM
@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

Frank

02/03/2022, 1:51 AM
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

Sahan Amadoruge

02/15/2022, 7:59 AM
Thank you
3 Views