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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -