t2v / play2-auth

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

Feature Request: expose logged in user in loginSucceeded #157

Open nefilim opened 9 years ago

nefilim commented 9 years ago

Is it possible to propagate the logged in user to

def loginSucceeded(request: RequestHeader)(implicit ctx: ExecutionContext): Future[Result] 

this seems like the ideal integration point for firing external events (audit logging for instance) but needs the applicable user to be useful. Or do you suggest another approach?

liorhar commented 9 years ago

+1

gakuzzzz commented 9 years ago

Sorry my late reply.

I agree this motivation.

However, I consider removing the loginSucceeded and logoutSuceeded method from AuthConfig in future release.

In essence, play2-auth should be only provide a Result => Result function what it call in Login action when the login is succeeded.

I think it is better that these procedure (that use User info, ex. logging) are defined in Login Action directly.

thiloplanz commented 8 years ago

I think I also need this in order to redirect every user to the appropriate top page (for that group of users) after login. Current workaround is to have a single controller for all that just dispatches based on group, but it would be nice to not need the extra level of indirection.