[akka-user][deprecated] Re: akka http custom directive - async

2018-05-28 Thread Sergey Tolmachev
oops, I'm sorry, I understood it: def withActiveSession: Directive1[Session] = { optionalHeaderValueByName("session").flatMap { case Some(session) => val s = Session(session) onSuccess(sessionRepository.validateSession(s)).flatMap { result => if (result) {

[akka-user][deprecated] Re: akka http custom directive - async

2018-05-28 Thread Sergey Tolmachev
Also faced such a problem: def withActiveAuth: Directive1[Session] = { optionalHeaderValueByName("session") { case Some(session) => val s = Session(session) onSuccess(sessionRepository.validateSession(s)) { result => if (result) { provide(s)

[akka-user][deprecated] Re: akka http custom directive - async

2018-04-24 Thread Muthu Jayakumar
Hello there, I shall repost this at discuss.lightbend.com. Thanks, Muthu On Monday, 23 April 2018 22:09:20 UTC-7, Muthu Jayakumar wrote: > > Hello there, > > I am trying to write a custom directive in akka http for something like > authorize (with a bit of difference from what's available