t2v / play2-auth

Play2.x Authentication and Authorization module
Apache License 2.0
608 stars 138 forks source link

get logged in user in a filter #159

Closed liorhar closed 8 years ago

liorhar commented 9 years ago

what would be the way to access the logged in user when writing a http filter? I mean the AuthElement trait assumes a controller in scope. is there a trait for filters?

gakuzzzz commented 8 years ago

The ActionBuilder of Play2(that play2-auth use internally) are resolved inside the Filter of Play2. So it is so difficult that you access in play2 filter.

You can use stackable-controller or ActionFunction instead of Play2 filter. Would you consider using it?