scala - DBAction together with IsAuthenticated: -


i have following code, complains:

could not find implicit value parameter session: play.api.db.slick.config.driver.simple.session

how fix it?

trait secured extends controller {    /**    * retrieve connected user id.    */   def username(request: requestheader) = request.session.get("email")    /**    * redirect login if use in not authorized.    */   def onunauthorized(request: requestheader): result    def isauthenticated(f: => string => request[anycontent] => result) =     security.authenticated(username, onunauthorized) { user =>       dbaction(request => f(user)(request))     } } 

i have following code:

object application extends controller secured {  ....   def list(modelname: string, page: int, orderby: int, filter: string) = isauthenticated{username=> implicit rs =>     ok(html.list(       model.byname(modelname),       page,       orderby, filter     ))   } 

you have import slick's session in controller

import play.api.db.slick.config.driver.simple.session ... object application extends controller secured {  ... 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -