Skip to content

Instantly share code, notes, and snippets.

//Trait that bridges between slick and Play2-auth. Just mixin with controllers
trait Auth2SlickBridge {
self: StackableController =>
def AuthAction[A](p: BodyParser[A], params: (RequestAttributeKey[_], Any)*)(f: RequestWithAttributes[A] => Action[A]): Action[A] = {
AsyncStack(p, params:_*) { implicit rs =>
f(rs).apply(rs)
}
}