playframework - securesocial 3.0-M3 get current user in view templates -
playframework - securesocial 3.0-M3 get current user in view templates -
i used utilize object method extracts user request.but in securesocial 3.0-m3 playframework 2.3.8, requestwithuser doesnt work anymore. there other way user or have pass user controller in 3.0?
userinfo
object userinfo { def getcurrentuser(implicit request: requestheader): option[identity] = { request match { case r: securedrequest[_] => some(r.user) case r: requestwithuser[_] => r.user case _ => none } } } view.scala.html
@(title: string)(content: html)(implicit request: requestheader) @import app.auth.userinfo <html> <head></head> <body>welcome @userinfo.getcurrentuser !</body> </html> playframework playframework-2.3 securesocial
Comments
Post a Comment