Last active
October 27, 2015 17:54
-
-
Save trane/4bfe681455e2cf18d2a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait LoginProvider { | |
val loginPath: Path // listen for POST on this | |
val location: String | |
def redirect: Response = | |
tap(Response(Status.Found))(_.location = location) | |
} | |
case class InternalLoginProvider(path: Path, hosts: String, loginPath: Path) extends LoginProvider { | |
val location = path.toString | |
val server = Http.newClient(hosts) | |
} | |
case class ExternalLoginProvider(url: URL, loginPath: Path) extends LoginProvider { | |
val location = url.toString | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment