playframework/Play20 — pull request #611 by julienrf (2012-12-12 22:03:07+00:00)
Title: Security.Authenticated returns EssentialAction instead of Action[(Action[A], A)]

I’m not sure it is the right way to do that but I wanted to remove the weird `Action[(Action[A], A)]` return type of the `Security.Authenticated` helper.

This patch has the advantage that the API change is small (the zentask sample still compiles), however I’m not sure the `Security` object is so useful. Actually each time I start a Play project I rewrite my own security helper. I prefer a signature (for the `Authenticated` function) that takes a function that returns a `Result` rather than an `Action[_]`:

```scala
def Authenticated[A](result: String => Request[A] => Result): Action[A]
```

And I often need something different that a `String` to identify the user (sometimes I use an `Int`, sometimes ). Maybe we should abstract over it:

```scala
def Authenticated[A, B](result: B => Request[A] => Result): Action[A]
```

What do you think?