https://kotlinlang.org logo
#ktor
Title
# ktor
f

frellan

02/09/2019, 9:56 PM
How do one conditionally apply authentication in ktor? 😛 I want to skip it in development since I do not send
basic
auth headers then
z

zpearce

02/09/2019, 10:13 PM
Auth is one of those things that I'm scared to put an on/off switch on. Wouldn't you rather just have a hard coded user/pass for your dev environment?
🤔 1
f

frellan

02/09/2019, 10:30 PM
the thing is that I serve a spa staticly with ktor in prod but in dev I just run a webpack server that talks to ktor running on another port. So I never get the basic auth prompt since its not ktor that is serving the stuff, only the REST calls fails instead
a

avolkmann

02/12/2019, 11:45 AM
how about an if statement ?
if (prod) install(auth) ...
5 Views