Permalink
Browse files

Added explanation for try/catch.

Removed try/catch from doAuthCallback as it is not needed.
  • Loading branch information...
1 parent d0eedec commit 37926ca8bcc2d13f8c8110b86b8e6133d208b246 Jonathan Ferguson committed Sep 20, 2011
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/main/scala/omniauth/view/Omniauth.scala
@@ -46,6 +46,8 @@ class Omniauth extends LiftView with Loggable {
if (p.providerName.equalsIgnoreCase(provider)) {
logger.debug("provider match")
try { p.signIn } catch {
+ //This is what we expect to happen, p.signIn should have a S.redirectTo(....) which will
+ //throw the following exception if the URL is not local.
case rse: LiftFlowOfControlException => throw rse
case kaboom: Exception => logger.error("attempting auth sign in ",kaboom)
}
@@ -61,10 +63,7 @@ class Omniauth extends LiftView with Loggable {
Omniauth.providers.foreach(p => {
if (p.providerName.equalsIgnoreCase(provider)) {
logger.debug("provider match")
- try { p.callback } catch {
- case rse: LiftFlowOfControlException => throw rse
- case kaboom: Exception => logger.error("attempting auth call back ",kaboom)
- }
+ p.callback
}
})
S.redirectTo(Omniauth.failureRedirect)

0 comments on commit 37926ca

Please sign in to comment.