Merge: lib/popcorn: introduce AuthHandler to check user session
### AuthHandler allows access to session user
Inherit this handler to access to session user from your custom handler.
For example, you need a profile handler that checks if the user is logged
before returning it in json format.
~~~nit
import popcorn::pop_auth
class ProfileHandler
super AuthHandler
redef fun get(req, res) do
var user = check_session_user(req, res)
if user == null then return
res.json user.json
end
end
~~~
By using `check_session_user`, we delegate to the `AuthHandler` the responsability
to set the HTTP 403 error.
We then check is the user is not null before pursuing.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Pull-Request: #2271
Reviewed-by: Jean Privat <jean@pryen.org>