Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Closes #981. Use earlyInStateful rather than addAround

  • Loading branch information...
commit 588936b1060ac6fa38969e0b76cbdf815ef46bf3 1 parent 6ca6da6
@dpp dpp authored
Showing with 8 additions and 11 deletions.
  1. +8 −11 nuggets/hellofbc/src/main/scala/bootstrap/liftweb/Boot.scala
View
19 nuggets/hellofbc/src/main/scala/bootstrap/liftweb/Boot.scala
@@ -66,16 +66,13 @@ class Boot {
S.addAround(DB.buildLoanWrapper)
//this is optional. Provides SSO for users already logged in to facebook.com
- S.addAround(List(new LoanWrapper{
- def apply[N](f: => N):N = {
- if (!User.loggedIn_?){
- for (c <- FacebookConnect.client; user <- User.findByFbId(c.session.uid)){
- User.logUserIn(user)
- }
- }
- f
- }
- }))
+ LiftRules.earlyInStateful.append {
+ case req if !User.loggedIn_? =>
+ for {
+ c <- FacebookConnect.client
+ user <- User.findByFbId(c.session.uid)
+ } User.logUserIn(user)
+ }
//this is really important for fb connect
LiftRules.useXhtmlMimeType = false
@@ -98,4 +95,4 @@ object DBVendor extends StandardDBVendor("org.h2.Driver",
Empty)
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.