packages feed

happstack-authenticate 2.1.5 → 2.2.0

raw patch · 5 files changed

+20/−48 lines, 5 filesdep ~lensPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: lens

API changes (from Hackage documentation)

- Happstack.Authenticate.Password.Forms: usernamePasswordForm :: (Functor m, Monad m) => XMLGenT (RouteT AuthenticateURL m) XML
+ Happstack.Authenticate.Password.PartialsURL: Login :: PartialURL
+ Happstack.Authenticate.Password.PartialsURL: instance GHC.Generics.Constructor Happstack.Authenticate.Password.PartialsURL.C1_6PartialURL
+ Happstack.Authenticate.Password.PartialsURL: rLogin :: Boomerang e tok r ((:-) PartialURL r)
- Happstack.Authenticate.Password.Partials: usernamePasswordForm :: (Functor m, Monad m) => Partial m XML
+ Happstack.Authenticate.Password.Partials: usernamePasswordForm :: (Functor m, Monad m) => Bool -> Partial m XML

Files

Happstack/Authenticate/Password/Controllers.hs view
@@ -5,7 +5,7 @@ import qualified Data.Text                  as T import Happstack.Authenticate.Core          (AuthenticateURL) import Happstack.Authenticate.Password.URL (PasswordURL(Account, Token, Partial, PasswordReset, PasswordRequestReset), nestPasswordURL)-import Happstack.Authenticate.Password.PartialsURL (PartialURL(ChangePassword, Logout, LoginInline, SignupPassword, ResetPasswordForm, RequestResetPasswordForm))+import Happstack.Authenticate.Password.PartialsURL (PartialURL(ChangePassword, Logout, Login, LoginInline, SignupPassword, ResetPasswordForm, RequestResetPasswordForm)) import Language.Javascript.JMacro import Web.Routes @@ -148,6 +148,15 @@         restrict: 'E',         replace: true,         templateUrl: `(showURL (Partial Logout) [])`+      };+    }]);++    // upLogin directive+    usernamePassword.directive('upLogin', ['$rootScope', 'userService', function ($rootScope, userService) {+      return {+        restrict: 'E',+        replace: true,+        templateUrl: `(showURL (Partial Login) [])`       };     }]); 
− Happstack/Authenticate/Password/Forms.hs
@@ -1,40 +0,0 @@-{-# LANGUAGE QuasiQuotes #-}-module Happstack.Authenticate.Password.Forms where--import HSP-import Happstack.Server.HSP.HTML            ()-import Language.Haskell.HSX.QQ              (hsx)-import Happstack.Authenticate.Core          (AuthenticateURL)-import Happstack.Authenticate.Password.URL  (PasswordURL)-import Web.Routes-import Web.Routes.XMLGenT                   ()---- usernamePasswordDiv x =---  <div ng-controller="UsernamePasswordCtrl">---- FIXME: there should be a way to include this via an angular directive-usernamePasswordForm :: (Functor m, Monad m) =>-                        XMLGenT (RouteT AuthenticateURL m) XML-usernamePasswordForm = [hsx|-    <div>-     <div ng-show="!isAuthenticated">-      <form ng-submit="login()" role="form" class="form-inline">-       <div class="form-group">-        <label class="sr-only" for="username">username</label>-        <input class="form-control" ng-model="user.user" type="text" id="username" name="user" placeholder="Username" />-       </div><% " " %>-       <div class="form-group">-        <label class="sr-only" for="password">password</label>-        <input class="form-control" ng-model="user.password" type="password" id="password" name="pass" placeholder="Password" />-       </div><% " " %>-       <div class="form-group">-       <input class="form-control" type="submit" value="Sign in" />-       </div>-      </form>-      <div>{{username_password_error}}</div>-     </div>-      <div ng-show="isAuthenticated">-       <a ng-click="logout()" href="">Logout</a>-     </div>-    </div>-  |]
Happstack/Authenticate/Password/Partials.hs view
@@ -64,7 +64,8 @@              -> Partial m XML routePartial authenticateState url =   case url of-    LoginInline    -> usernamePasswordForm+    LoginInline    -> usernamePasswordForm True+    Login          -> usernamePasswordForm False     Logout         -> logoutForm     SignupPassword -> signupPasswordForm     ChangePassword ->@@ -104,11 +105,12 @@   |]  usernamePasswordForm :: (Functor m, Monad m) =>-                        Partial m XML-usernamePasswordForm = [hsx|+                        Bool+                     -> Partial m XML+usernamePasswordForm inline = [hsx|     <span>      <span ng-show="!isAuthenticated">-      <form ng-submit="login()" role="form" class="navbar-form navbar-left">+      <form ng-submit="login()" role="form"  (if inline then ["class" := "navbar-form navbar-left"] :: [Attr Text Text] else [])>        <div class="form-group">         <label class="sr-only" for="username"><% UsernameMsg %> </label>         <input class="form-control" ng-model="user.user" type="text" id="username" name="user" placeholder=UsernameMsg />
Happstack/Authenticate/Password/PartialsURL.hs view
@@ -12,6 +12,7 @@  data PartialURL   = LoginInline+  | Login   | Logout   | SignupPassword   | ChangePassword@@ -24,6 +25,7 @@ partialURL :: Router () (PartialURL :- ()) partialURL =   (  "login-inline"         . rLoginInline+  <> "login"                . rLogin   <> "logout"               . rLogout   <> "signup-password"      . rSignupPassword   <> "change-password"      . rChangePassword
happstack-authenticate.cabal view
@@ -1,5 +1,5 @@ Name:                happstack-authenticate-Version:             2.1.5+Version:             2.2.0 Synopsis:            Happstack Authentication Library Description:         A themeable authentication library with support for username+password and OpenId. Homepage:            http://www.happstack.com/@@ -28,7 +28,6 @@                        Happstack.Authenticate.Route                        Happstack.Authenticate.Password.Controllers                        Happstack.Authenticate.Password.Core-                       Happstack.Authenticate.Password.Forms                        Happstack.Authenticate.Password.Partials                        Happstack.Authenticate.Password.PartialsURL                        Happstack.Authenticate.Password.Route@@ -65,7 +64,7 @@                        safecopy                     >= 0.8  && < 0.9,                        mime-mail                    >= 0.4  && < 0.5,                        mtl                          >= 2.0  && < 2.3,-                       lens                         >= 4.2  && < 4.13,+                       lens                         >= 4.2  && < 4.14,                        pwstore-purehaskell          == 2.1.*,                        text                         >= 0.11 && < 1.3,                        time                         >= 1.2  && < 1.6,